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

Link Child/Master Fields outside of subform?...

Status
Not open for further replies.

Woodman650

Technical User
Jan 20, 2005
92
0
0
US
Hey guys,
I have a subform appearing to display some info and I'd like to be able to hit an "edit" button which loads a form to edit this info. Basically, what I'm trying to do is have the form open and go to the record that is open in the original subform. So for example, if I'm viewing Record A, I want to have the edit form open and automatically load in the data for Record A... if I'm viewing Record B, load the data for Record B... etc

Right now, I'm using a subform which gives me the option to link master/child fields which has been working fine. My child field was the table entry "Title" and my master field with a selected objct in a listbox. Anyone know how I can do this? thanks
 

Take a look at the 4th argumnent of the OpenForm method of
DoCmd Property. Your button should have somthing like:

DoCmd.OpenForm "SubFormName", acNormal, , "PrimaryKey=" & Forms![MasterFormName].Controls!txtPrimaryKey.Value, acFormEdit

I assume ther is a primary key which you need to get the exact record you want to show when the subform is opened
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top