Having trouble retrieving record value

mercredi 11 mars 2015

I'm trying to retrieve the value of a record in a table. Why doesn't this work:



tabName = "Plan Data"



Dim db As DAO.Database, rst As Recordset

Dim strQryWhole As String

Dim dbStatus As Integer, rcnt As Long



strQryWhole = _

"SELECT Table_Info.Database_Status FROM Table_Info " _

& "WHERE (Table_Info.Table_Name)= '" & tabName & "';"



Set rst = db.OpenRecordset(strQryWhole)



rst.MoveFirst



For rcnt = 0 To rst.RecordCount



MsgBox rst.Fields("Database_Status").Value



rst.MoveNext



Next rcnt



I'm getting run time error 91 at 'Set rst'command.



Thanks.

Having trouble retrieving record value

0 commentaires:

Enregistrer un commentaire

Labels