Input value from one form to another

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
 
K

Ken Snell

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top