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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Goto Record

Status
Not open for further replies.

zorro19s

Programmer
Jul 20, 2001
13
CA
Lets say I want to go to show(highlight or point) record number 5 in a subform, how would I do that?
 
Depends what type of object your talking about - list box, combo box, or just record #5 in your recordset.
 
I have a table and on another subform just field list textboxes.

In the table, I would like it to point to the recordset or highlight the recordset.

In the field list textboxes I would like simply to go to a specific record.
 
Me![your subform].SetFocus

Dim SyncCriteria As String
Dim rs As DAO.Recordset

'Define the from object and recordset object for the form
Set rs = Me![your subform].Form.RecordsetClone

' define the criteria used for the sync
SyncCriteria = "[yourKeyfield]= " & Somevalue

' find the corresponding record in the Parts table
rs.FindFirst SyncCriteria
Me![Contacts subform].Form.Bookmark = rs.Bookmark
---------------------
This code requires you to know the unique ID of record number 5. Then it sets a bookmark to it and sets focus to it.
Suppose you have Contacts in the subform then you would have to know the ContactID of record number 5
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top