Results 1 to 4 of 4
  1. #1
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31

    select case or else if for unhiding

    I have a command button that is set up to open an email message box when pushed. I also have various check boxes that people check if something is updated. What would be the best option to basically say: If any of the 10 checkboxes is checked (all reference different columns), then unhide the button so that an email can be sent. Otherwise leave it invisible as nothing was updated. I was fine doing visibility when there was only one criteria for determining if the text box should be visible, but with multiple variables I am confused.


    Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If the only CheckBoxes on the form are the ones you want to check then a For Each ctl...Next loop would probably be the best approach.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by nichmeg
    If any of the 10 checkboxes is checked
    (another idea) For something as simple as this, you could use:

    Code:
    Sub SetButtonState()
          Me.ButtonName.Visible = Me.Chk1+Me.Chk2+Me.Chk3+Me.Chk4+Me.Chk5+Me.Chk6+Me.Chk7+Me.Chk8+Me.Chk9+Me.Chk10
    End Sub
    (change the names in blue to your names)

    Call the function to set the visible state for the button.

  4. #4
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    Thanks, Ill give it a whirl. I figured it wouldnt be too difficult, but Im still trying to learn.

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

Similar Threads

  1. Select Case vs Dlookup
    By BRV in forum Programming
    Replies: 1
    Last Post: 10-28-2011, 03:18 PM
  2. Command Buttons - Hiding/Unhiding
    By Hello World in forum Forms
    Replies: 4
    Last Post: 10-10-2011, 07:51 AM
  3. Select Case using query field
    By focosi in forum Programming
    Replies: 4
    Last Post: 08-15-2011, 11:00 AM
  4. Help with Select Case statement
    By focosi in forum Access
    Replies: 4
    Last Post: 08-09-2011, 12:01 AM
  5. Replies: 3
    Last Post: 05-06-2011, 02:49 PM

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