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!

retrieve/insert ID from form1 to form2

Status
Not open for further replies.

yuchieh

MIS
Jul 21, 2000
178
US
I have two forms (program and locations) that are linked by programID.

Users go into Program Form, enter data, the programID is autoID. Then there is a "Add Location" button, to open Locations Form. And users can enter location information into Locations Form. One program can have multiple locations.

When clicking on that "add location" button, how do I retrieve the ProgramID from current Program form and insert into a new record in Location form/table?

Originally I thought of selecting "Max(programID)" from Program table. But what if users go back to previous entered Program Form and add more locations later on?

I am not familiary with VB. I tried to use macro, but not really successful.

Please Help!!

Thanks
 
A classical way is a Locations linked subform.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried the subform. Then I saw only one subform is be displayed in the main form. How do I make the button (or whatever) to add "unlimited" subforms?

Thanks
 
I think I figured it out.

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top