Results 1 to 5 of 5
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Change Change FormHeader Color

    Default for form is to NOT allow edits. Check213 is a CheckBox on my form
    The code below is run when it is checked.


    I want to change the FormHeader Color back when the checkbox is Unchecked.
    Back to Cornflower


    Me.AllowEdits = True 'Allows Edits
    Me.FormHeader.BackColor = vbRed 'Changes color to red





    booWhatever = Me.Check213 'This is run on the OnCurrentEvent of the main form.It is my Default.
    If booWhatever Then
    FormHeader.BackColor = colorBlue_Cornflower

    End If

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    So what is the issue? Is this code not working - error message, wrong results, nothing happens?

    What is colorBlue_Cornflower - a user defined constant?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    What is NOT working is that it does not upon unchecking the checkbox set the forms mode to NOT allow editing.

    booWhatever = Me.Check213 On OnCurrentEvent of main form. Sets parameter for checkbox


    booWhatever = Me.Check213
    If booWhatever Then
    FormHeader.BackColor = colorBlue_Cornflower 'Color set by code in mod.
    Label217.Caption = "Edits NOT Allowed" 'Captions work correctly
    Me.AllowEdits = True

    Else
    FormHeader.BackColor = colorTan_Encarnacion
    Label217.Caption = "Edits Allowed"
    Me.AllowEdits = True

    End If

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe the first AllowEdits should be

    Me.AllowEdits = False

    Once that code executes, won't be able to change the checkbox value.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thanks, I knew it was something simple,just could not think. BTW, it took me over 2 1/2 days but I finished writing the complete help file for the db with the user being able to edit as they wish. Brain dead after all that.

    Thanks, that worked.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Text box change color
    By Ray67 in forum Forms
    Replies: 14
    Last Post: 11-19-2012, 04:06 PM
  2. Using an event to change color of text.
    By michaeljohnh in forum Programming
    Replies: 3
    Last Post: 08-30-2010, 12:30 PM
  3. Change as per condition font color
    By miziri in forum Programming
    Replies: 1
    Last Post: 08-20-2009, 04:23 AM
  4. Color change in form filed
    By miziri in forum Programming
    Replies: 3
    Last Post: 08-15-2009, 04:53 PM
  5. change cell color
    By bishop743 in forum Programming
    Replies: 0
    Last Post: 02-01-2009, 11:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums