Howto post data into different tables through one form?

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

Hi, all
I have two tables. One is Order, another is
Order_Detail. I generate a form base on Order table. I
want to add a text boxes to input data into
Order_Detail's Quality. But the text box can not access
Order_Detail's Quality. How can I implement it.
Thanks in advance!
 
sounds like you have a standard parent-child relationship
between your two tables. a standard method for handling
data entry on such is to create a mainform/subform setup.
main form should be bound to Orders table and subform
should be bound to Order_Detail table. LinkChildFields and
LinkMasterFields should be set for the subform control in
the mainform, to establish the relationship between the
two.

hth
 
Thanks you very much!

tina said:
sounds like you have a standard parent-child relationship
between your two tables. a standard method for handling
data entry on such is to create a mainform/subform setup.
main form should be bound to Orders table and subform
should be bound to Order_Detail table. LinkChildFields and
LinkMasterFields should be set for the subform control in
the mainform, to establish the relationship between the
two.

hth
 
Hi, tina
Thanks for your reply. I created a mainform/subform according to
Order/Order_Detail table. Now I found a question: I input an order. I must
type the Product_Item. I want to choose the Product_Item form Product table.
The step is:
1. Choose the Product_Item from Product table. Further more, when I choose
the Product_Item, I can see the related cost.
2. Post the Product_Item into Order_Detail table.
I don't know how to implement it. Would you help me? Thanks!

Best Regard
 
i'll base my answer on the assumption that your Products
table has the following fields (your names may be
different, of course):

tblProducts
ProID (primary key)
ProName
ProDescription
ProUnitPrice

in the Order_Detail subform, change the text box (where
you enter the ProductID) to a combo box. set the RowSource
query or Select statement to show the ProID, ProName and
ProUnitPrice fields, in that order.

set the ColumnCount to 3. set the Bound Column to 1. set
the Column Widths to 0"; 1"; 1". (adjust the widths to
suit you, but keep the first one at 0" - unless the
primary key has meaning and is used for data entry.)

now the product name will show in the combo box droplist,
with the unit price beside it.

hth
 
Back
Top