Checking if a record exists from a form button on update

Copper Contributor

Hi

I have a bit of a problem.  I have a form with a date dropdown combo,  "WeekCommCombo". After update I am trying to check in the table to see if there is a record with the date already in the table. if there is then display one message and if there isn't display the message "Run Query".  However, when I run it it does nothing.  Not even an error message.  (Code below)

ajcbutler_0-1620144073033.png

Any ideas what I can get this to work?

Thanks

Aaron

1 Reply

@ajcbutler 

Your SQL is looking for a DATE to match a DATE in the field "Week_Commencing". That suggests a couple of possibilities.

One, are the values in question actually DATES, or strings FORMATTED to look like dates. To the human eye, of course, they could appear to be the same, but to Access the Date DataType is different from the string datatype.

Two, your SQL uses the string delimiter, which is the apostrophe ' but you are trying to work with dates. so you'd want to use the date delimiter # instead.