Re: Open SubForm based on ComboBox selection

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 01/16/05


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]


Relevant Pages

  • Re: Open SubForm based on ComboBox selection
    ... Claude wrote: ... >My Platform is Access 2000 ... >Parent Form. ... AfterUpdate event procedure. ...
    (microsoft.public.access.formscoding)
  • Re: OT: Computer geeks in the US
    ... Claude V. Lucas wrote: ... are few solutions in that platform for any of my needs ... other than the Knoppix auditing bundle. ...
    (alt.guitar)
  • Open SubForm based on ComboBox selection
    ... My platform is Access 2000 ... Visible = False (Not visible in Parent Form) ... Is this at all possible??, if so, some sample code would be greatly ... Thanking you in advance ...
    (microsoft.public.access.formscoding)
  • Re: Setting a value on parent for in CE 5.0
    ... the value on the parent form and closes the window. ... <script language='javascript'> ... I don't think IE on CE platform supports scripting. ...
    (microsoft.public.scripting.jscript)