• Different subforms depending on combo box choice (2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Different subforms depending on combo box choice (2002)

    Author
    Topic
    #444629

    Yes, I can put all the fields that I want in one table, create a tabbed subform and select the fields I want for each tab to give the look of 4 separate forms. I can do this and that is fine, but is there a way to have separate subforms that appear automagically depending on the value in the form?

    Viewing 0 reply threads
    Author
    Replies
    • #1075780

      You can set the Visible property of the various pages of your tabbed subform to true or false in the after update event of the combo box, depending on the value selected in the combo box.

      e.g.

      if me!combosomething = 1 then
      me!TabControl.page1.visible=true
      me!TabControl.page2.Visible=false
      else
      me!TabControl.page1.visible=false
      me!TabControl.page2.Visible=true
      end if

      Here you need to replace all the names with the correct ones, and add the right condition(s)

      • #1077714

        Thanks for everything, John. Unfortunately, this is much, much to complex for me. My learning curve on visual basic is rather steep right now. I’ll just stick to cramming all the fields I need in one table and show the ones I need for each value on the tabs that apply to it.

        I do appreciate your reply, though. Maybe one day I will comprehend all of this. I understand it in principle

    Viewing 0 reply threads
    Reply To: Different subforms depending on combo box choice (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: