aziz rasul
Active member
- Local time
- Today, 07:21
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have the following code: -
Set rstqry = dbs.OpenRecordset("qryLO ID Count", dbOpenDynaset)
LOPID_Count = rstqry.RecordCount
rstqry.MoveFirst
On most occasions the recordset rstqry has x number of records. However on other occasions there are no records and hence I receive the "Run Time Error 3021". How can I alter the code so that it does not come up with this error?
Set rstqry = dbs.OpenRecordset("qryLO ID Count", dbOpenDynaset)
LOPID_Count = rstqry.RecordCount
rstqry.MoveFirst
On most occasions the recordset rstqry has x number of records. However on other occasions there are no records and hence I receive the "Run Time Error 3021". How can I alter the code so that it does not come up with this error?