Form/Subform Data Entry

  • Thread starter Thread starter Jason Gyetko
  • Start date Start date
J

Jason Gyetko

I have a form with a subform on it. The main form is set up as single forms
and the subform is set up as continuous forms. They are both updating the
same table, just different fields. What I want is for all fields on both
the main form and subform to be updated into the source table for each
record added in the subform. Right now, it works the way I want it to for
the first record, but then when I enter the second record in the subform,
only that data in the subform is updated in the table, thus leaving all the
corresponding main form fields in the table blank. How do I get the data on
the main form to also be written to the table (for each subform record)?
Hope that makes sense... Thanks.
 
I'm not quite sure why you would have a main/subform combination based on
the same table. Generally speaking, this form setup is used to handle data
manipulation in a Master-Child relationship. The Main form contains details
about the Parent record, and the subform would contain details about each
individual Child record ... when you add a new Child record, the Main record
normally does NOT change. Your query/table that your subform is based would
be related to the query/table your Main form is based on via one or more
fields, but these details would be stored in two (or more) separate tables.

Consider an Invoicing system. In this example, your Main form would contain
details specific to the Invoice (i.e. the Date, who it is billed to, etc
etc), while your Subform would contain the items which make up the Invoice
(the specific item, quantity, cost etc). When you add a new InvoiceItem, you
would NOT want to add a new "Parent" Invoice ... and you normally would not
update the Parent Invoice (unless you're storing the calculated value of all
InvoiceItems in the Parent Invoice for performance reasons) when a new
InvoiceItem was added or and existing one edited.

Please post your basic table structure, and indicate what fields are being
updated by the Main form and by the Subform.
 
I'm building a Certificate of Analysus Picklist table, the form structure is
as follows, all data entry form fields are fields in the Picklist table.

Main Form
------------
Company: XXXXXXX Delivery Date: ##/##/####
PO: XXXXXXX Site: XX
Item: XXXXXXX Packout: XXXXXX
Customer: XXXXXXXXXXXXXXXXXXXXXXXXXX
Comments: XXXXXXXXXXXXXXXXXXXXXXXXXX

Subform
---------
Blend Quantity
XXXXXXXXXX ######
YYYYYYYYYY ######
ZZZZZZZZZZZZ ######

Table should look like:
Cmpy PO Item Cust Cmnts DDte Site Pout Blend QTY
------ --- ---- ----- ------ ----- ----- ----- ----- -----
XXX XX XX XX XXX ### XX XX XX #X#
XXX XX XX XX XXX ### XX XX YY #Y#
XXX XX XX XX XXX ### XX XX ZZ #Z#

If I can do it without a subform that would be great, but I don't know how I
can add multiple records for Blend & Quantity without having to re-enter all
the main form data for each record.
 
Back
Top