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
 
Back
Top