open query in report code

P

Patrick Stubbin

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
 
M

Marshall Barton

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
 
P

Patrick Stubbin

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
 
Top