Access VBADiscuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
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?
EXAMPLE:
'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
rstTempWip.MoveLast
End If
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