Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
ADO RecordSet Navigation
William Austin 
   
4 years ago
I have an open ado recordset bound to a from using
Set Forms("frmEmployeeDetails").Recordset = rs.

I have added a rs.movenext, rs.moveprevious etc sub routines to the access class object module.

The recordset Current = rs.AbsolutePosition
Total = rs.RecordCount move properly but

the new records are not displayed on the form. Only the first record is shown.

Any help  correcting this issues appreciated.

Private Sub Form_Load()
iblink = 0
Me.TimerInterval = 0

Dim SQL As String
SQL = "SELECT * FROM dbo.tblEmployee"
ConnectDataBase
    
    Set rs = New ADODB.Recordset
    
    rs.Source = SQL
    Set rs.ActiveConnection = DBconn
    rs.LockType = adLockOptimistic
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenKeyset
    
    
    rs.Open
    
        Set Forms!frmEmployeeDetails.Recordset = rs

        'Set Forms("frmEmployeeDetails").Recordset = rs
        
        rs.MoveFirst
        Me.txtID.Value = rs!EmployeeID
        Me.txtFirstName.Value = rs!FirstName
        Me.txtLastName.Value = rs!LastName
        Me.txtHomePhone.Value = rs!HomePhone
        Me.txtMobilePhone.Value = rs!MobilePhone
        Me.txtStreetAddress.Value = rs!StreetAddress
        Me.txtCity.Value = rs!City
        Me.txtState = rs!State
        Me.txtZipCode = rs!Zipcode
        Me.txtUserName = rs!UserName
        Me.txtEmail = rs!Email
        Me.txtPassword = rs!Password
        Me.txtNotes = rs!Notes

Me.RecordSelectors = False
Me.txtShowMeTheWay.TextAlign = 2
txtID.SetFocus
If rs.RecordCount > 0 Then ShowMeTheWay

'Me.txtID.SetFocus

'If rs.RecordCount > 0 Then
'Debug.Print rs.RecordCount
'End If

'rs.Close
'Set rs = Nothing
'CloseDataBase
End Sub


Private Sub ShowMeTheWay()
Dim Current As Long, Total As Long

Current = rs.AbsolutePosition
Total = rs.RecordCount
txtShowMeTheWay = Current & "/" & Total

End Sub


Alex Hedley  @Reply  
           
4 years ago
Why do you need to do it in code and not just bind the Form to a Query?
Alex Hedley  @Reply  
           
4 years ago
(I think RecordSets begin in Access Developer 16)
Kevin Robertson  @Reply  
          
4 years ago
You need to loop through all the records in the Recordset to display them all. You're moving to the first record and only displaying that one record.
Richard Rost  @Reply  
           
4 years ago
William, did you write that code yourself or just copy and paste it from a web site? Have you worked with Recordsets before? You've only taken one seminar from me, so I don't know your skill level... but that's definitely not how I write Recordsets. I can teach you how to write the code PROPERLY, but I can't fix what you've got there. Totally different methodology.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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: 6/22/2026 3:16:14 PM. PLT: 0s