Search

Thedon123

Registered User.
Local time
Today, 08:26
Joined
Sep 11, 2002
Messages
98
i have a text where the user enetrs a code. what i need to do is to check that the code he has entered is correct by checking it with the codes that are held in a query. ho would go about doing that.
 
Say the code is entered into a textbox, txtCode


PHP:
If IsNull(DLookup("[Code]","qryCodes","[Code] = '" & txtCode & "'") Then
    MsgBox "That is not a valid code."
    Exit Sub
End If
 
Last edited:
soory mate i understand the code. but do i have to declare txtcode and code before this code.
 
Code:
 is equivalent to whatever the field is called in your query, substitute txtCode for whatever your textbox is called or alternatively rename your textbox to txtCode.

So, no you don't have to declare these.

Rich
 
Thanks for the help pat.

THe problem is i have atleast 69000 records. the combo box does not display all of these. what i want to do is to let the user enter the value in a text and then check it against a query to see that it exists. the code above does not seem to do that. is there another way. i can check against a table also if the query is causing the error.
 

Users who are viewing this thread

Back
Top Bottom