Hi there,
I have a split database. On the backend there is a linked table with all the dates of the public holidays occuring in the next few years. The table is called "ArbFreieTage" and the column with the dates is called "Datum". When I open the form "Außenpforte" I would like to check if the date in the field "Datum" on the form is in the table contained int the column. If it is I would like a message box to be displayed, if not then nothing is to happen. I have tried all variations of the code but the message box occurs every time even if the date is not in the table:
If DLookup("[ArbFreieTage]", "Datum", "[Datum] = #" & Forms!Außenpforte!Datum) & "#" Then MsgBox "Public Holiday"
What am I doing wrong?
I have a split database. On the backend there is a linked table with all the dates of the public holidays occuring in the next few years. The table is called "ArbFreieTage" and the column with the dates is called "Datum". When I open the form "Außenpforte" I would like to check if the date in the field "Datum" on the form is in the table contained int the column. If it is I would like a message box to be displayed, if not then nothing is to happen. I have tried all variations of the code but the message box occurs every time even if the date is not in the table:
If DLookup("[ArbFreieTage]", "Datum", "[Datum] = #" & Forms!Außenpforte!Datum) & "#" Then MsgBox "Public Holiday"
What am I doing wrong?