Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display different subforms based on combo box (Access 2K, Win 2K Pro)

    This is probably easy but I don't recall ever having to do it... I have a main form and a combo box; when the user selects a value in the combo box I want a corresponding subform to display. The main form table has a field that is intended to link to the same column name/type in each subform/table.

    TIA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Display different subforms based on combo box (Access 2K, Win 2K Pro)

    Put code in the After Update event of the combo box. If the combo box lists the names of the subforms in the database window, you can use

    Private Sub ComboName_AfterUpdate()
    Me.SubformControl.SourceObject = Me.ComboName
    End Sub

    If the name of the subform has to be derived from the item selected by the user, you can use a Select Case statement.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display different subforms based on combo box (Access 2K, Win 2K Pro)

    Thanks- worked great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •