Searching a table

durdle

Registered User.
Local time
Today, 19:34
Joined
May 7, 2002
Messages
130
Good day,

I am here trying to figure out some vba. I have a date textbox on my form and when the user enters a particualr date I want to search through a table"tblStatdate"(this has only one field in it with 7 values) and if the date entered is in the table i want it to go inside the if statement and display an error. Below is a bit of the code, I know it will involve an SQL statement or something.

If txtvdate.Value = "Any of the Date's in the table" then
Msgbox ("Blah")

Else
Blah
End if

Any help would be great.
Thanks
________
vaporizer wholesale
 
Last edited:
If DCount("FieldNameInTable","tblStatdate","FieldNameInTable = Forms!YourFormName!txtvDate")>0 Then
MsgBox "Your message"
End If
 
Hey Dan-Cat,

That function worked like a Big Mac Combo, supersized. :)

Thanks
________
ford xc falcon
 
Last edited:
:D I'm taking it worked then

Jolly good show!
 

Users who are viewing this thread

Back
Top Bottom