Results 1 to 4 of 4
  1. #1
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    53

    Field visibility based on ComboBox selection

    I have a form that will have several dropdown combo boxes, each option will cause a series of fields to change from invisible to visible. I got the first part of that to work. The problem I am having is while flipping through the records, that field remains visible/invisible based on the last selection. Below is the code I am using. The first combobox is named Involved (both name and control source), and the second is named Involvement (name is Label37, haven't gotten around to renaming it yet). How do I get it to adjust the Visible setting based on the Involved combobox and retain that setting for each record?

    Here is the code I am using:

    Private Sub Involved_Change()
    If Involved = "Yes" Then
    Label37.Visible = True
    Involvement.Visible = True
    Else
    Label37.Visible = False
    Involvement.Visible = False


    End If
    End Sub

    Edit: Also, how would I accomplish the same thing (adjusting the visible settings and making them change with the record) to tabs?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    2,923
    Assuming that Involved is Bound to a Field in your underlying Table, and that the Form is in Single View (which I assume to be true, considering the question about a Tabbed Control) you need to place the same code in the Form_Current event, as well as the OnChange event. The same thing would apply to the formatting of the Tabbed Control.

    Code pretty much has to be in the Form_Current event anytime you want formatting changes to be Record-specific.

    Doing formatting to Continuous or Datasheet View Forms is limited, in most cases, to using Continuous Formatting from the Menu/Ribbon, and has a limited set of Options.

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

    All posts/responses based on Access 2003/2007

  3. #3
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    53
    Awesome, works perfect. Thank you.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    2,923
    Glad we could help!

    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: 17
    Last Post: 01-11-2013, 01:53 PM
  2. Replies: 8
    Last Post: 01-25-2012, 02:07 PM
  3. Populate a field based on combobox selection
    By rscott7706 in forum Access
    Replies: 5
    Last Post: 06-02-2011, 03:18 PM
  4. Visibility based on Combo selection
    By jlclark4 in forum Forms
    Replies: 1
    Last Post: 12-22-2010, 11:42 AM
  5. Replies: 0
    Last Post: 04-17-2008, 09:24 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
  •  
Tech Forums: Microsoft Office Forums