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

populating form and subforms input into same table

Status
Not open for further replies.

rony01

MIS
Sep 12, 2012
8
US
hi
I am new to ms access.I have created a form in designer and added a sub form to it with source object to a table. I want to add multiple records from sub form to table. I have two fields name date and entry no # in which I will input same values in multiple rows. I would like to know if I add two text boxes in the main form and bind to columns entry no# and date how to assign these text box input to all rows entered through subform?

Thanks
 
In the subform control (the container holding the subform) you will see the properties
linkMaterFields:
linkchildFields:

If there are two fields that link the main table to the sub table then you list the names of both fields seperated by a semicolon
[entry no#];[Date]

BTW both of your fields names are horrible. Never put spaces in a field name, never use special characters, and never use reserved words such as a name of a function (Date is a vba function to return the date). You do all three. Better is
Entry_Number
Entry_Date

If you establish the link you do not have to do anything else. It will populate the child fields, and or filter on the child fields. If the Master fields are not field names but just unbound controls on the main form you can do that as well. Example
linkMaterFields:txtBxEntry_Number;txtBxEntry_Date
linkchildFields:[entry no#];[Date]

I have to use [] for any "bad" field names. Not required otherwise.



 
Thank you so much for your reply. I have not tried yet but I would like to know would the text box input populate main tables field with equal row of sub form records?
 
I would like to know would the text box input populate main tables field with equal row of sub form records?
I do not know what you are asking. If you set up a normal Main Form - Sub Form, every record added to the subform will be given a foreign key value that relates it to the parent record in the main form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top