Input value from one form to another

  • Thread starter Thread starter John Newman
  • Start date Start date
J

John Newman

I am a novice at access, and have been asked to write a database for users
to enter demographic information into.
I have two tables (tblname) and (tbladdress).

tblname consist of the following fields: NameID (autonumber), Fname, Lname,
SSN, and DOB

tbladdress consist of: address ID (autonumber), NameID (the relation field
to tblName), City, State, Zip

In my forms I would like to be able to press a button on the name form and
have the address form automatically open, with the NameID all ready filled
in from the Name form. I have been able to accomplish this, but I am not
able to save the information into the address table, because it tells me
that a related record has to exist in tblname.

Please help
Thanks
 
This is what subforms are designed to handle for you. Set up a form and put
a subform on it. Set the main form's recordsource to be a query that is
based on tblname table. Set the subform's recordsource to be a query that is
based on tbladdress table. Link the main form and the subform together
through the NameID field in both recordsources (do this via the Link Master
Fields and Link Child Fields properties on the subform control). Then the
subform will automatically be linked to the main form.
 
Back
Top