open query in report code

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

Guest

I have the following code:

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Reportname As String

Set db = CurrentDb
Set rst = db.OpenRecordset("Select * From [Analytes and Worksheets query] ")
i
rst.MoveFirst




how do i check if there are any records existing prior to rst.movefirst
 
Patrick said:
I have the following code:

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Reportname As String

Set db = CurrentDb
Set rst = db.OpenRecordset("Select * From [Analytes and Worksheets query] ")
i
rst.MoveFirst

how do i check if there are any records existing prior to rst.movefirst


UseL

If rst.RecordCount > 0 Then
rst.MoveFirst
Else
'no records
End If
 
thanks
--
Regards


Patrick Stubbin


Marshall Barton said:
Patrick said:
I have the following code:

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Reportname As String

Set db = CurrentDb
Set rst = db.OpenRecordset("Select * From [Analytes and Worksheets query] ")
i
rst.MoveFirst

how do i check if there are any records existing prior to rst.movefirst


UseL

If rst.RecordCount > 0 Then
rst.MoveFirst
Else
'no records
End If
 

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

Back
Top