Results 1 to 3 of 3
  1. #1
    tammiep is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    4

    coding to refer to multiple checkboxes and labels

    Hello Everyone,
    Wondering if anyone can help me with this.

    I have a form with several checkboxes (~50) on it. What I would like to do is have the label of each checkbox (the name of each label begins with lbl) change to the RGB value of (210, 0, 0) if the checkbox is checked. So, the labels all start off black, but to make it easier for the user to see which checkboxes have been ticked, I would like all the checked ones to have red labels.

    I was using IF Else in the afterupdate event of each checkbox, but wondered if there was a way using wildcards to refer to all of the checkboxes and labels at once. All checkbox names start with"chk" and all labels start with "lbl".



    Thanks,
    Tammie

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    there needs to be consistency with the names Tammie. You need to be able to identify the names of the controls. make sense? e.g. -
    Code:
    dim c as control
    
    for each c in me.controls
       if instr(c.name, "checklbl")>0 then 'IT IS A CHECKBOX LABEL
          //CHANGE THE COLOR
       end if
    next c
    does that make sense? codify your controls so they are "loopable"

  3. #3
    tammiep is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    4
    Thanks very much Adam--I will give this a try.

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

Similar Threads

  1. Filtering a report from multiple checkboxes
    By sabre1 in forum Reports
    Replies: 2
    Last Post: 01-17-2011, 03:37 PM
  2. Replies: 10
    Last Post: 11-23-2010, 10:16 PM
  3. select multiple checkboxes in access 2003?
    By GoneFusion in forum Forms
    Replies: 2
    Last Post: 09-20-2010, 01:44 PM
  4. Preventing multiple checkboxes
    By emerywang in forum Forms
    Replies: 2
    Last Post: 01-26-2010, 01:43 PM
  5. Refer to main form
    By terryvanduzee in forum Forms
    Replies: 3
    Last Post: 10-23-2009, 07:02 AM

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