Simply do a check to make sure that the recordset actually contains records before doing the recordcount. i.e.:
rstMyRecordset.Open "SELECT * FROM tblMyTable;"
With rstMyRecordset
If .BOF and .EOF then
'empty recordset
Else
rstMyRecordset.MoveLast
RecordCount = rstMyRecordset.RecordCount
End if
End With
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only