I have a script in my access DB that automatically fills in a form and creates a confirmation letter. All of it works except it's supposed to flag up if the customers booking is on a raceday (horse racing) as we're near a track and traffic is increased.
Dim Israceday as Variant
Israceday = DLookup("[RACEDAYS!israceday]", "RACEDAYS", _
"[RACEDAYS!racedate] = " & BookDate)
If Israceday = "Y" Then
RaceMsg = MsgBox("THIS BOOKING IS ON A RACEDAY. Please enclose a raceday traffic warning notice with the confirmation letter.", vbInformation + vbOKOnly, "Raceday Warning")
I think the problem lies with the dates. At the beginning it says 'Dim BookDate as Date' and that value is taken from another table. The list of dates in the RACEDAYS table is in DD/MM/YY format but for some reason I think it's this that is causing conversion that's problems, Ie when I make a booking with a date I know is in that table, it just returns a null value and halts the script.
Any ideas?? Thanks!