Re: Open SubForm based on ComboBox selection
From: Marshall Barton (marshbarton_at_wowway.com)
Date: 01/16/05
- Next message: Bill Sturdevant: "RE: Link to SQL Server via code"
- Previous message: brupp24_6: "vba: end sub if data in tbl A matches data in table b"
- In reply to: Claude: "Open SubForm based on ComboBox selection"
- Next in thread: Marshall Barton: "Re: Open SubForm based on ComboBox selection"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 16 Jan 2005 10:26:04 -0600
Claude wrote:
>My Platform is Access 2000
>
>I have a Parent Form that has 3 SubForms (Form1, Form2, Form3) set at
>Visible = NO. (Not visible on Parent Form)
>I then have a ComboBox with 3 lookup fields (Field1, Field2, Field3) in the
>Parent Form.
>
>What I am NOT able to code is the following:
>When selecting "Field1" in ComboBox; "Form1" must be set to Visible = True
>When selecting "Field2" in ComboBox; "Form2" must be set to Visible = True
>When selecting "Field3" in ComboBox; "Form3" must be set to Visible = True
>Is this at all possible?? , and if so, I would greatly appreciate a sample
>code
Note that the code below uses FormX as the name of the
subform **control** on the main form, which may or may not
be the same as the name of the form object they are
displaying.
Select Case Me.combobox
Case "Field1"
Me.Form1.Visible = True
Me.Form2.Visible = False
Me.Form3.Visible = False
Case "Field2"
Me.Form2.Visible = True
Me.Form1.Visible = False
Me.Form3.Visible = False
Case "Field3"
Me.Form3.Visible = True
Me.Form1.Visible = False
Me.Form2.Visible = False
End Select
-- Marsh MVP [MS Access]
- Next message: Bill Sturdevant: "RE: Link to SQL Server via code"
- Previous message: brupp24_6: "vba: end sub if data in tbl A matches data in table b"
- In reply to: Claude: "Open SubForm based on ComboBox selection"
- Next in thread: Marshall Barton: "Re: Open SubForm based on ComboBox selection"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|