Loop through a recordset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is my first attempt at trying to use recordsets in code. What I want to do is loop through the records in table1.field1 and reurn to the msgbox
I'm not quite there but close

Any suggestions
Joh

Sub recordsetTemp(

Dim dbs As DAO.Databas
Dim rst As DAO.Recordse

Set dbs = CurrentD
Set rst = dbs.OpenRecordset("Table1", dbOpenTable

With rs
Do While Not .EO
MsgBox (field1
.MoveNex
Loo
End Wit

End Sub
 
MsgBox (field1)

Staying with your "With" statement, try modifying the syntax of this line
to:
MsgBox (.Fields("Field1"))

Note the dot before Fields.

--
Wayne Morgan
Microsoft Access MVP


John said:
This is my first attempt at trying to use recordsets in code. What I want
to do is loop through the records in table1.field1 and reurn to the msgbox.
 
Back
Top