p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   Recordset Empty Check (http://p2p.wrox.com/showthread.php?t=57211)

Coby April 27th, 2007 10:18 AM

Recordset Empty Check
Is there a way to check if a recordset has no data?
I get a "no current record" error because ther is none.
I simply want to use an if statement to check for data first.
Any Ideas would be appreciated?

'Empty the TempTable of all Old Work
    Set rstTempWip = dbs.OpenRecordset("TempWipBatch", dbOpenTable)
    If rstTempWip. 'I am trying to check if the recordset is empty here "" Then
    End If

martinrhague April 27th, 2007 10:36 AM

Hi Coby

This is what I use to check. if no records, then it exits the function. Obviously if you want it to do other things, just put the else statement in there

If rstTempWIP.RecordCount <= 0 Then Exit Function

Hope this helps


Coby April 27th, 2007 04:09 PM

Thanks, that did the trick.


All times are GMT -4. The time now is 12:36 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.