Not empty recordset?

J

Jules DiMarco

I understand that you can use the following code to check
whether a dataset is empty:

If rstRecordset.BOF And rstRecordset.EOF

But how do you check whether a recordset is not empty?

I've tried doing a recordcount but get an error when
attempting to move the last record if the recordset is
indeed empty!
 
M

Marshall Barton

Jules said:
I understand that you can use the following code to check
whether a dataset is empty:

If rstRecordset.BOF And rstRecordset.EOF

But how do you check whether a recordset is not empty?

I've tried doing a recordcount but get an error when
attempting to move the last record if the recordset is
indeed empty!


Another way is to check if the recordset has at least one
record:

If rstRecordset.RecordCount > 0 Then
 
Top