Can you do validation from tables using code (1 Viewer)

paulmcdonnell

Ready to Help
Local time
Today, 18:30
Joined
Apr 11, 2001
Messages
167
Hi Access Nutters...


I want my code to chech if a feild is one of a list of items.... I can set it up using 'IF's but the criteria can change over time. What would be good is if I could check the field against a table. I'm not so sure how to go about this ... has anyone done this before...Any help would be ace

cheers

Paul
 

Jack Cowley

Registered User.
Local time
Today, 18:30
Joined
Aug 7, 2000
Messages
2,639
I am not sure what you mean by the Criteria can change over time, but you could use something like this:

If Not IsNull("[LookupField]","tblLookup", "[LookupField] = '" & Me![MyField] & "'") Then
Msgbox "This field exists in the table."
Else
Do whatever
End if

[This message has been edited by Jack Cowley (edited 08-17-2001).]
 

Users who are viewing this thread

Top Bottom