Results 1 to 4 of 4
  1. #1
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183

    Hide combo box unless a field value is...

    I have a phone type field on a form. If my user selects MOBILE I want the form to SHOW an additional field called phone carrier.



    How can I do this?

    The table will store the carrier record ID BTW.
    Last edited by dniezby; 01-07-2016 at 06:24 AM.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    use the AFTERUPDATE event when the user updates the combo box for type of phone...
    Code:
    sub cboPhoneType_Afterupdate()
       cboCarrier.visible = cboPhoneType = "MOBILE"
    end sub

  3. #3
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183
    Thanks this worked!

    How do I get it to show the field label too? I added another line to the code but it gives me an error.

  4. #4
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183
    Never mind. I must have had an error in my code. I got it to work.
    Code:
    Private Sub cboPrimaryPhone_AfterUpdate()
    cboPrimaryCarrier.visible = cboPrimaryPhone = "1"
    Label35.Visible = cboPrimaryPhone = "1"
    
    End sub
    The 1 is the Record ID number to the record that has Mobile from the phone type table.

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

Similar Threads

  1. Hide used values in combo box
    By mrmims in forum Programming
    Replies: 1
    Last Post: 07-03-2013, 12:22 AM
  2. Combo Box value hide/show Image
    By alyon in forum Access
    Replies: 7
    Last Post: 12-13-2012, 09:48 AM
  3. Replies: 1
    Last Post: 01-10-2011, 12:25 AM
  4. Replies: 1
    Last Post: 09-27-2010, 06:58 AM
  5. Replies: 6
    Last Post: 06-03-2009, 02:01 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