Greetings,
I'm trying to use the DoCmd.OpenForm function to open a form to the record with the following matching criteria (fname (text datatype); lname(text datatype); and date (date/time datatype)).
I am using the string:
stLinkCriteria = "[fname]=""" & Me![fname] & """" & _
" AND [lname]=""" & Me![lname] & """" & _
" AND [pdate]= " & Me![pdate]
In the command:
DoCmd.OpenForm stDocName, , , stLinkCriteria
in my Where condition. It doesn't work. It opens the form but there are no matching records (though there should be). The function works when the PDATE is not part of the Where condition.
EXAMPLE OF WORKING CONDITION:
stLinkCriteria = "[fname]=""" & Me![fname] & """" & _
" AND [lname]=""" & Me![lname] & """"
Is there something about the Date/Time datatype that is making this not work? Does anyone have any idea about what I'm doing wrong?
Thanks for your help,
Criseyde
I'm trying to use the DoCmd.OpenForm function to open a form to the record with the following matching criteria (fname (text datatype); lname(text datatype); and date (date/time datatype)).
I am using the string:
stLinkCriteria = "[fname]=""" & Me![fname] & """" & _
" AND [lname]=""" & Me![lname] & """" & _
" AND [pdate]= " & Me![pdate]
In the command:
DoCmd.OpenForm stDocName, , , stLinkCriteria
in my Where condition. It doesn't work. It opens the form but there are no matching records (though there should be). The function works when the PDATE is not part of the Where condition.
EXAMPLE OF WORKING CONDITION:
stLinkCriteria = "[fname]=""" & Me![fname] & """" & _
" AND [lname]=""" & Me![lname] & """"
Is there something about the Date/Time datatype that is making this not work? Does anyone have any idea about what I'm doing wrong?
Thanks for your help,
Criseyde