Opening another form from a textbox entry

  • Thread starter Thread starter Lorraine
  • Start date Start date
L

Lorraine

I have individual data entry forms for individual tables
in my database. I would like to have my users open one
data entry form and when they select an option from a
combo box I would like one of 5 different data entry forms
to open based on the combo box selection. How can I make
this happen?
 
Your options should be in a table that looks like this:
TblOption
OptionID
Option

and OptionID should be 1 to 5.

You can then put the following code in the AfterUpdate event of the combobox:

Select Case Me!NameOfCombobox
Case 1
DoCmd.OpenForm "DataEntryForm1"
Case 2
DoCmd.OpenForm "DataEntryForm2"
Case 3
DoCmd.OpenForm "DataEntryForm3"
Case 4
DoCmd.OpenForm "DataEntryForm4"
Case 5
DoCmd.OpenForm "DataEntryForm5"
End Select
 
Thanks for the help but it is still not working. How do I
link to the options table?

I have also created OpenForm macros and have tried to put
the following code in the event of the combobox but this
did not work either:

Am I missing a step?

Private Sub cmbID_tag_LostFocus()
Select Case Me!cmbID_tag
Case 1
DoCmd.RunMacro (OpenN_switches_Entry_Form)
Case 2
DoCmd.RunMacro (OpenID_tags_other_Entry_Form)
Case 3
DoCmd.RunMacro (Openprinters_Entry_Form)
Case 4
DoCmd.RunMacro (OpenS_Entry_Form)
Case 5
DoCmd.RunMacro (OpenC_Entry_Form)
End Select
End Sub
 
Back
Top