Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to BOF EOF    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Checking EOF After OpenRecordset
Thomas Gonder 
       
20 days ago
I'm curious, how could you open a record set (which is supposed to bookmark the first record), that does have at least one record, and then get rs.EOF = True? So, how could testing only rs.EOF, when first opening, be wrong?
Richard Rost  @Reply  
          
18 days ago
You're right. If you have just opened a normal DAO Recordset and have not moved it anywhere yet, checking rs.EOF alone is sufficient. A non-empty recordset opens positioned on its first record, so rs.EOF is False. An empty recordset has both rs.BOF and rs.EOF set to True, so rs.EOF is True.

So, in this specific case:

If rs.EOF Then

  ' No records

End If

is perfectly valid.

The reason I teach the rs.BOF And rs.EOF test is that it explicitly means "this recordset contains no records" and remains correct even if someone later adds navigation before that test. rs.EOF by itself can also mean, "There were records, but I moved past the last one."

But yes, immediately after OpenRecordset, EOF alone will do the job. Good catch.

Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/31/2026 3:30:50 AM. PLT: 1s