If Statement

DJ_DEF_CON_1

Registered User.
Local time
Today, 07:44
Joined
Jan 1, 2003
Messages
40
I have a hidden form with a text box field that I am trying to query. The following is giving me problems. Any ideas?

If Forms![SCRATCH_PAD]![tbxUSER_ID] = 'DELUCAK' Or 'MOULTONM' Or 'ROBERTSD' Or 'SCALFD' Then

When I select the command button that has the above as an event procedure, I get a syntax error.
 
If Forms![SCRATCH_PAD]![tbxUSER_ID] = 'DELUCAK' Or Forms![SCRATCH_PAD]![tbxUSER_ID] = 'MOULTONM' Or Forms![SCRATCH_PAD]![tbxUSER_ID] = etc.....



Too long


Code:
Select Case Forms![SCRATCH_PAD]![tbxUSER_ID]
    Case Is = DELUCAK, "MOULTONM", "ROBERTSD", "SCALFD"
        ' do something
    Case Else
End Select
 
Thanks - I learned something new. I appreciate the help.

Mile-O-Phile said:
If Forms![SCRATCH_PAD]![tbxUSER_ID] = 'DELUCAK' Or Forms![SCRATCH_PAD]![tbxUSER_ID] = 'MOULTONM' Or Forms![SCRATCH_PAD]![tbxUSER_ID] = etc.....



Too long


Code:
Select Case Forms![SCRATCH_PAD]![tbxUSER_ID]
    Case Is = DELUCAK, "MOULTONM", "ROBERTSD", "SCALFD"
        ' do something
    Case Else
End Select
 

Users who are viewing this thread

Back
Top Bottom