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

click on row in subform to display record on form 1

Status
Not open for further replies.

hefly

Technical User
Feb 6, 2008
134
US
I have a form with a subform. Both off the same table. tbl_A. There is currently, no child-master linking.

I just wanted to display all records on the subform.

I would like to click on a row in the subform sfrm_B to display that specific record on the form.

How can I do that? The matching fields on the form and subform would be RowID.

Thanks.

Hefly
 
You could use code in the On Current event of the subform like:
Code:
Private Sub Form_Current()
    'assuming RowID is numeric
    Me.Parent.Filter = "RowID = " & Me.RowID
    Me.Parent.FilterOn = True
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Duane:

Thank you! The code doesn't like

the first line, Private Sub Form_Current() is yellowed out,
and the line:

Me.Parent.FilterOn = TrueEnd Sub

"reds out" with "syntax error."
 
Awesome! It works!!!

Thank you Duane!

Hefly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top