Good morning all,
Access 97
I'm trying to use a date field (date of birth) as part of a process to check and see if the customer already exist in our db. I'm using a DLookup variant (varDOB) to search the db for a matching DOB then in my code I'm asking if the date of birth typed in this new record matches varDOB to fire a message.
In my testing I picked a record that I know matches but never get the message. I'm using other fields besides the DOB field to see if there's a matching record. I have tried each field individually to see if they work and they all do except the DOB, so I'm thinking it has something to do with it being a date field.
Could someone lend a hand on how to do this? Please!
Heres the part of the code for DOB
Dim varDOB As Variant
varDOB = DLookup("DOB", "Customers", "[DOB] = Forms![Customers]![DOB]"
If Me.DOB = varDOB Then
MsgBox "etc,etc"
TIA
Shane
Access 97
I'm trying to use a date field (date of birth) as part of a process to check and see if the customer already exist in our db. I'm using a DLookup variant (varDOB) to search the db for a matching DOB then in my code I'm asking if the date of birth typed in this new record matches varDOB to fire a message.
In my testing I picked a record that I know matches but never get the message. I'm using other fields besides the DOB field to see if there's a matching record. I have tried each field individually to see if they work and they all do except the DOB, so I'm thinking it has something to do with it being a date field.
Could someone lend a hand on how to do this? Please!
Heres the part of the code for DOB
Dim varDOB As Variant
varDOB = DLookup("DOB", "Customers", "[DOB] = Forms![Customers]![DOB]"
If Me.DOB = varDOB Then
MsgBox "etc,etc"
TIA
Shane