Not empty recordset?

  • Thread starter Thread starter Jules DiMarco
  • Start date Start date
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!
 
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
 
Back
Top