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

move to record when I click on field in subform

Status
Not open for further replies.

tbac

Technical User
Jun 16, 2003
59
US
I have a main form and a subform. I want to move to a specific record in the Main form when I click on the field 'Name' in the subform, but when I do I get the message, "Not a valid bookmark". Here is the event that runs in the subform when you double-click on the 'Name' field:

Dim Main As Form, rst As DAO.Recordset

Set Main = Forms!CrossesPED2ChooseParents.Form

'Sync forms
Set rst = Me.RecordsetClone
rst.FindFirst "[NAME] = '" & Me![NAME] & "'"
Me.Bookmark = rst.Bookmark
Main.Bookmark = rst.Bookmark
 
How is the mainform's record related to the subform's NAME control ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
How are ya tbac . . .

In parallel with [blue]PHV[/blue] is the subForm synchronized with [blue]Master/Child link[/blue] properties?

Try this:
Code:
[blue]Dim frm As Form
   
   Set frm = Forms(Me.Parent.Name)
   
   frm.Recordset.FindFirst "[NAME] = '" & Me![NAME] & "'"
   
   set frm = nothing[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top