Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form record navigation using recordset

Status
Not open for further replies.

gacaccia

Technical User
May 15, 2002
258
US
i'm sure this has been asked before, but i couldn't quite find the answer. i'm using an access 2003 ADP project to connect to a sql server 2000 db. i have a form which displays records and i also have a combo box that links to the primary key for the records. i want the user to be able to navigate sequentially using the standard access navigation controls, but i also want the user to be able to jump to records using the combo box. to this end, i thought to use the forms recordset with the "find" method. however, this isn't causing the form to navigate to selected record. i don't want to use "filter" because the user would then no longer be able to navigate sequentially.

here's the code...

Code:
Private Sub cbxSectionSelect_AfterUpdate()
    Dim rst As ADODB.Recordset
    Dim recordID As Integer

    Set rst = Me.Recordset
    recordID = Me.sectionID
    rst.MoveFirst
    rst.Find "sectionID = " & recordID
    rst.Close
End Sub
 
well, found the problem. stupid mistake on my part. "find" method is working fine. problem was with my code. i was telling it to find "me.sectionID", which is the current record, hence no change. i should have been telling it to find "me.cbxSectionSelect", which has the value of the sectionID to find. changed code and it works as expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top