met12
June 3rd, 2004, 09:23 PM
Trying to pull a match from access table acclabel using VB 5.0.
Getting a Block error message on the Set rst line. Anyone see what is wrong?
Thanks,
met12
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim MyStr As String
MyStr = "1212"
Set dbs = OpenDatabase("c:\vb\invenVB.mdb")
Set rst = dbs.OpenRecordset("Select AccountName from acclabel Where 4digitCode = '" & MyStr & "'", dbOpenDynaset)
MsgBox "The AccountName is: " & rst.Fields(0).Value
Getting a Block error message on the Set rst line. Anyone see what is wrong?
Thanks,
met12
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim MyStr As String
MyStr = "1212"
Set dbs = OpenDatabase("c:\vb\invenVB.mdb")
Set rst = dbs.OpenRecordset("Select AccountName from acclabel Where 4digitCode = '" & MyStr & "'", dbOpenDynaset)
MsgBox "The AccountName is: " & rst.Fields(0).Value