No Current Record

  • Thread starter Thread starter Bill Reed via AccessMonster.com
  • Start date Start date
B

Bill Reed via AccessMonster.com

I'm trying to test for No Current Record in a DAO recordset. It happens
when my strSQL returns a blank recordset from the db. I was trying to use
IsNull(rs(0)) or IsNull(rs.Fields(0)) but they don't work. Any suggestions?
 
Bill

If I may suggest the following:

dim dbs as DAO.Database
dim rst as DAO.Database

Set dbs = CurrentDB()
Set rst = dbs.OpenRecordSet("Select FirstName From Table1")

' Here's the keypoint....
If not (rst.bof and rst.eof) Then
' There is data in the recordset
Else
' There is no data in the recordset
End If

Set rst = nothing
Set dbs = nothing


HTH
Rob

--
FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

FMS Advanced Systems Group
http://www.fmsasg.com/
 
Back
Top