I need to check if a value exists in a database prior to allowing users to input. This is the syntax that I have but it gives me a type mismatch error
User ID is a field on my form, and has an int value in my table which is why I CSTR()Code:Private Sub UserID__Exit(Cancel As Integer) If CurrentDb.OpenRecordset("Select count(*) from [Table With Spaces Data] where [User ID]=" & CSTR(" & Me.[User ID] & ") > 0) Then MsgBox ("This userid has already been created!") End If End Sub