print records from a recordset

L

lloyd gordon

I am using Debug.print to print records from a recordset
(dbOpenDynaset). I get a runtime ERROR 3001, invalid
argument. Your help is greatly appreciated.

Thank You.
 
A

Albert D. Kallal

You might want to post the 5, or 6 lines of code as to what you are doing.
(it is consider bad to post large chunks of code, but if you just post the
5, or 6 lines of code where the problem is, then that is ok.

So, for example, to field in the debug window, the follwing code works for
me:


Dim rstRecs As DAO.Recordset
Dim strSql As String

strSql = "select * from tblCustomers where City = 'Edmonton'"
Set rstRecs = CurrentDb.OpenRecordset(strSql)

Do While rstRecs.EOF = False
Debug.Print rstRecs!LastName
rstRecs.MoveNext
Loop
rstRecs.Close
Set rstRecs = 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