Opening a recordset from current database

G

Guest

What's the syntax for opening a recordset from a table the
current database? (I want to be able to loop through the
records in a table, so I assume I open a recordset.)

Thank you.
 
P

PC Datasheet

Dim Db As DAO.Database
Set Rst = DAO.Recordset
Set Db = CurrentDb()
Set Rst = Db.OpenRecordset("MyTable")

<<Cycle Through Recordset Here >>

Rst.Close
Set Rst = Nothing
Set Db = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top