Results 1 to 5 of 5
  1. #1
    agouveia is offline Novice
    Windows 10 Access 2007
    Join Date
    Nov 2018
    Posts
    2

    Controls on Continuous Form - Conditional Formatting

    Hi Everyone,

    I have an Access Continuous form in which I created some conditional formatting (some controls are locked upon loading and then unlocked depending on certain information being filled out). The conditional formatting works great when entering information into the form. Although, when exiting and then going back into the form, if you go back to that record, the controls that were unlocked are now locked and you would have to activate the conditional formatting again by choosing specific controls. I could always adjust data in the back end but I would rather the form not keep the conditional controls locked when going back into that specific record.

    Thanks in advance for your help.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Sorry but this is confusing to me.
    Conditional formatting is used to change the appearance of various controls.
    What has that got to do with locking controls?

    Controls should be locked by using e.g. Me.MyControlName.Locked = True
    If you have a large number to lock at once, the Tag property works well for that purpose

    If you then want to change the appearance of those locked controls, that can also be done by e.g.

    Code:
    If Me.MyControName.Locked Then
    
    Me.MyControlName.BackColor=vbCyan
    Else
    Me.MyControlName.BackColor=vbWhite
    End If
    etc....
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    agouveia is offline Novice
    Windows 10 Access 2007
    Join Date
    Nov 2018
    Posts
    2
    To clarify, some controls are already locked upon loading the form. Conditionally, these can be unlocked and if so, they can be used. Although, if exiting the form and then going back in to that record, the previously unlocked controls are locked yet again. I hope that makes sense.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    It makes sense but only because you haven't referred to conditional formatting (CF) this time!
    So what's the problem again? Nothing to do with CF?
    Perhaps some screen shots would help (if you can do that as a new user)

    And, belatedly, welcome to the forum
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Your code for unlocking the Controls needs to be in the Form_Current event, as well as wherever else it resides (maybe in the AfterUpdate event of another Control) in order for the Locked/Unlocked status to remain Record specific, as you move from Record-to-Record.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 18
    Last Post: 04-11-2016, 03:23 PM
  2. Replies: 3
    Last Post: 08-02-2013, 12:18 PM
  3. Replies: 2
    Last Post: 12-22-2012, 07:49 AM
  4. Replies: 7
    Last Post: 10-01-2012, 07:59 AM
  5. Replies: 1
    Last Post: 06-22-2012, 03:33 PM

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