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

Click on subform gives record in mainform

Status
Not open for further replies.

Thijs

Technical User
Nov 24, 2000
31
NL
I've got the following problem.
I created a mainform with some fields on it.
In those fields people can fill date, time and location.
The primary key consists of date/time/user_id
To make selection in the future more easy etc I created a field afspraak_id. Just in case.

Now I have this subform on which people can see how many appointments they have made and where they will be.
This selection is done on user_id.

But what I want next is that when people click on a row in the subform is that the appropriate record in the mainform comes visible.

Any idea how I can do that?

Thanks in advance,

Thijs Kromhout
The Netherlands.
 
To get you started, in the Subform control On Click event open up a recordset clone of the main form and do a find on whatever matches from your subform. Then set the bookmarks equal and presumably return focus to the main form.

Good Luck!
 
Thanks a lot. I've searched for the right code. And it seems to work for now! Muchos gracias :)

Grtz,

Thijs Kromhout
The Netherlands

ps: it is the following code:

Private Sub Form_Click()

Dim rsClone As Recordset
Set rst = Me.RecordsetClone

Forms!terugkeer!afspraak_id.SetFocus

DoCmd.FindRecord Me!afspraak_id, acEntire, False, acSearchAll, True, acAll


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top