StacyStacy
A "Californian" at heart!
- Local time
- Today, 15:15
- Joined
- Jan 29, 2003
- Messages
- 159
I have the following code to validate data to ensure it's correctly keyed in and not a duplicate.
I have keyed in the county code of 014 and I get a run-time error of 3464 - Data Mismatch. Why?
Here's the code place in the "Before Update event:
Dim MyVar As Variant
Dim County_Exists As Boolean
County_Exists = False
MyVar = DLookup("[COUNTY_NO]", "[COUNTY]", "[COUNTY_NO] =" & Me.COUNTY_NO)
If MyVar = Me.COUNTY_NO Then
County_Exists = True
End If
Thanks for your help.
I have keyed in the county code of 014 and I get a run-time error of 3464 - Data Mismatch. Why?
Here's the code place in the "Before Update event:
Dim MyVar As Variant
Dim County_Exists As Boolean
County_Exists = False
MyVar = DLookup("[COUNTY_NO]", "[COUNTY]", "[COUNTY_NO] =" & Me.COUNTY_NO)
If MyVar = Me.COUNTY_NO Then
County_Exists = True
End If
Thanks for your help.