misuser2k7
MIS
I am trying to use CASE statement with two conditions. The issue I am experiencing is as follows.
I have a form (Form0) with two combo boxes and a command button. Values from both combo boxes are required to open other unique forms (one form for one pair of values from the two combo boxes) which are used for specific data entry requirements into specific tables after clicking a command button on the first form after selecting specific values from both combo boxes.
The CASE statement is used as shown below:
-----------------------------------------------------------------
Private Sub cmdButton1_click()
Select Case Me.Combobox1 And Me.Combobox2
Case “Value1FromCombobox1” And “Value2FromCombobox”
Docmd.Openform “Form1”
Case “Value2FromCombobox1” And “Value3FromCombobox”
Docmd.Openform “Form2”
.
.
.
.
.
End Select
End Sub
--------------------------------------------------------------------
But nothing happens when the command button is clicked i.e. second form does not open. I don’t get any errors either.
What is the correct syntax for using ‘And’ in the above CASE statement?
Thank you.