H
HLCruz via AccessMonster.com
I am creating some code for a button on a form and I seem to be having a
problem with the following "SQL" I've written in VBA. I tested it using a
Zip that I knew existed but keep getting the "Zip Not Found" message box.
I'm using some code I've found in a book that I've customized to y database.
Does anyone see a problem with what I've written so far? Thanks to anyone
who will look this over!
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set conn = CurrentProject.Connection
ssql = "Select * From MNZIPS Where ZIP=' " & Me.txtZip & " ' "
rs.Open ssql, conn, adOpenKeyset, adLockOptimistic
If rs.RecordCount = O Then
rs.Close
Set rs = Nothing
Set conn = Nothing
MsgBox "Zip Not Found"
Exit Sub
problem with the following "SQL" I've written in VBA. I tested it using a
Zip that I knew existed but keep getting the "Zip Not Found" message box.
I'm using some code I've found in a book that I've customized to y database.
Does anyone see a problem with what I've written so far? Thanks to anyone
who will look this over!
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set conn = CurrentProject.Connection
ssql = "Select * From MNZIPS Where ZIP=' " & Me.txtZip & " ' "
rs.Open ssql, conn, adOpenKeyset, adLockOptimistic
If rs.RecordCount = O Then
rs.Close
Set rs = Nothing
Set conn = Nothing
MsgBox "Zip Not Found"
Exit Sub