M
Mirza
I've created a lookup for city using the Zip code.However,
I get always the Error Msg.Data type mismatch in criteria
expression.I've also tried different criterias like:
" WHERE (zipcode.ZIP)LIKE '" & me!zip & "*') "
" WHERE (zipcode.ZIP)=" & Chr$(34) & Me!ZIp& Chr$(34)
but it won't work.Date type is text.
Thanks
Mirza
Private Sub Zip_AfterUpdate()
Dim strSQL As String
Dim rst As Recordset, dbs As Database
Set dbs = CurrentDb
strSQL = " SELECT * FROM zipcode "
strSQL = strSQL & " WHERE (zipcode.ZIP) = " & Me!Zip
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveFirst
Me.City.Value = rst!City
I get always the Error Msg.Data type mismatch in criteria
expression.I've also tried different criterias like:
" WHERE (zipcode.ZIP)LIKE '" & me!zip & "*') "
" WHERE (zipcode.ZIP)=" & Chr$(34) & Me!ZIp& Chr$(34)
but it won't work.Date type is text.
Thanks
Mirza
Private Sub Zip_AfterUpdate()
Dim strSQL As String
Dim rst As Recordset, dbs As Database
Set dbs = CurrentDb
strSQL = " SELECT * FROM zipcode "
strSQL = strSQL & " WHERE (zipcode.ZIP) = " & Me!Zip
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveFirst
Me.City.Value = rst!City