I have spend an humble time - 4-5 months far away from city and could not get into this forum. ( no internet)
I am now back into programming trying to create a small application to check if a number entered on a unbound form exist in the table. However the following code generates
runtime error "3464" - Data mismatch in Criteria expression.
Could someone figure out what would be the problem.
I am using Access 97
Expand|Select|Wrap|Line Numbers
- Dim strSQL As String
- Dim db As DAO.Database
- Dim rs As DAO.Recordset
- Set db = CurrentDb()
- 'Set rs = db.OpenRecordset("tblcheck", dbOpenDynaset, dbAppendOnly)
- Set rs = db.OpenRecordset("Select System_ID FROM tblcheck WHERE System_ID ='" & Me.System_ID & "'")
- If rs.RecordCount <> 0 Then
- MsgBox "System_ID already exixt !"
- Else
- 'insert into table
- End If
- End Sub