Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with IF, False. VBA code (Access). 1

Status
Not open for further replies.

Husameddin

Technical User
Mar 4, 2003
17
GB
I am using Access and this VBA code

Cancel = False
If ([Type] <> &quot;Cruiser&quot;) Then
MsgBox &quot;Error You can only use Centaur Or Cruiser in this Route”
End If

i want the code to give error message if the user enter Cruiser or Centaur i tried with (Or) but did not work. i used the (,) between the two words but did not work as well.

Please help

 
If ([Type] <> &quot;Cruiser&quot; AND [Type] <> &quot;Centaur&quot;) Then
MsgBox &quot;Error You can only use Centaur Or Cruiser in this

etc etc etc Rgds
Geoff
&quot;Some cause happiness wherever they go; others whenever they go.&quot;
-Oscar Wilde
 
Oh my god this the fastest reply I have ever got thank you very very much XLBO it worked ;o)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top