I have a form that I would like to update with an ID after saving. I would like to look up the ID after saving with the phone number provided.
My form text box Phone1 has the data with an input mask, like (555) 555-5555, saving as 5555555555.
The data table field Phone1 also has the same input mask, and saves the data without the mask.
The data table field Phone 1 is Short Text, and the form field Phone1 is Plain Text.
I am using this code to lookup the FamilyID field in the Family table with the Phone1 field.
Code:
Me.FamilyID = DLookup("[FamilyID]", "Family", "[Phone1] = " & Me.Phone1)
I keep getting a "Data Type Mismatch" error.
I can save to the field using an INSERT INTO query, but I can't seem to lookup after saving.