I'm trying to create a command button on my form that opens a corresponding report. My problem is that I have a "data type mismatch in criteria expression."
My code is this:
DoCmd.OpenReport stDocName, acPreview, , "[ClinicalID]='" & Me![ClinicalID] & "'"
The field I am using as the criteria, [ClinicalID], is an autonumber field. However, the way I have the code, I think access interprets it as text and thus the mismatch error.
Does anyone know how to change my where statement so that it specifies [ClinicalID] as autonumber and not text data type?
Thanks in advance for all help!
My code is this:
DoCmd.OpenReport stDocName, acPreview, , "[ClinicalID]='" & Me![ClinicalID] & "'"
The field I am using as the criteria, [ClinicalID], is an autonumber field. However, the way I have the code, I think access interprets it as text and thus the mismatch error.
Does anyone know how to change my where statement so that it specifies [ClinicalID] as autonumber and not text data type?
Thanks in advance for all help!