Form with two tables?

G

Guest

hello all...

I have an orders form that I use for new order entries, but I want to
"connect" it to another table so that I can enter shipping details on each
order as it arrises?

So, this is what I have: tblorders with ordernumber, orderdate,
orderdetails, etc and tbl shipping ordernumber, shippment date, shippment
cost, etc...

when I enter a new order on my order form, I want that order number saved
to both my tblorders and my tlbshippingordernumber so that I can then set up
another form form my shipping information...

Hope this is clear and hope someone can help me...

Brook
 
J

John Vinson

hello all...

I have an orders form that I use for new order entries, but I want to
"connect" it to another table so that I can enter shipping details on each
order as it arrises?

So, this is what I have: tblorders with ordernumber, orderdate,
orderdetails, etc and tbl shipping ordernumber, shippment date, shippment
cost, etc...

when I enter a new order on my order form, I want that order number saved
to both my tblorders and my tlbshippingordernumber so that I can then set up
another form form my shipping information...

Hope this is clear and hope someone can help me...

Brook

Simply put the Shipping form onto the Order form, as a Subform. Make
OrderNumber the MasterLinkField and ShippingOrderNumber the Child Link
Field.

John W. Vinson[MVP]
 
M

Marshall Barton

Brook said:
I have an orders form that I use for new order entries, but I want to
"connect" it to another table so that I can enter shipping details on each
order as it arrises?

So, this is what I have: tblorders with ordernumber, orderdate,
orderdetails, etc and tbl shipping ordernumber, shippment date, shippment
cost, etc...

when I enter a new order on my order form, I want that order number saved
to both my tblorders and my tlbshippingordernumber so that I can then set up
another form form my shipping information...


You could do it that way by executing an append query in the
form's AfterInsert event.

A better way would be to have a button on the orders form
that opens the shipping form filtered to the current order
number. Or, in the case of no existing shipping record,
uses the OpenForm method's OpenArgs argument to pass the
order id to the shipping form so it can set the value
itself.

However, if you have the available form space, place the
shipping form as a subform in the orders form. Setting the
Link Master/Child properties will set the order id value in
shipping automatically.
 

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