VBA Data Validation

abbaddon223

Registered User.
Local time
Today, 05:53
Joined
Mar 13, 2010
Messages
162
Hi all,

I'm banging my head a little on this one...

I'm try to set a condition in a control on a form that will warn a user if they have input an incorrect tariff code.

I'm trying:

If [TariffCode] = "28258000" Or "28332600" Then
MsgBox "Tariff Code Accepted", vbInformation, "User Update"
Else
MsgBox "Not A Valid Tariff Number", vbCritical, "Critical Warning"
[TariffCode].Value = ""
End If

This just keeps giving me the message that the tariff code has been accepted even if this code is not listed...:mad:

Any help would be greatly appreciated please.
 
You have to repeat the field:

If [TariffCode] = "28258000" Or [TariffCode] = "28332600" Then
 
What a star!! Thanks a lot.:)
 

Users who are viewing this thread

Back
Top Bottom