print records from a recordset

  • Thread starter Thread starter lloyd gordon
  • Start date Start date
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.
 
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
 
Back
Top