C
Carlos Saez
I'm new to Access and have dificulties trying to check whether a record
exists or not, based on its primary key that is a date field.
The user enters a date in a date formatted field in a form, and the code
tries to check whether a record exists with that key.
DateExists = DLookup("[MyDate]", "MyTable", "[MyDate] = " & DateEntered)
I allways get DateExists as Null.Getting into debugging, I know that
DataEntered has a value that exists into the table and formatted properly
(dd/mm/yyyy in my case).
The sentence:
DateExists = DLookup("[MyDate]", "MyTable", "[MyDate] =
dateserial(2005,1,6)")
gets a proper (not null) result. That is a value that exists into the table.
Please, some help.
Regards,
Carlos.
exists or not, based on its primary key that is a date field.
The user enters a date in a date formatted field in a form, and the code
tries to check whether a record exists with that key.
DateExists = DLookup("[MyDate]", "MyTable", "[MyDate] = " & DateEntered)
I allways get DateExists as Null.Getting into debugging, I know that
DataEntered has a value that exists into the table and formatted properly
(dd/mm/yyyy in my case).
The sentence:
DateExists = DLookup("[MyDate]", "MyTable", "[MyDate] =
dateserial(2005,1,6)")
gets a proper (not null) result. That is a value that exists into the table.
Please, some help.
Regards,
Carlos.