Form/subform

G

Guest

I have a form/subform for recording orders. On the subform the product id is
a combo box(controled by a query) that displays only the products that are
ordered by the customer in the customer id field on the main form. It works
fine on the first record I enter, but the problem is it woun't change the
data on the next record unless you leave the form and come back. Any
suggestions?
 
B

Brett Collings [429338]

Should be simple to fix, but we'll need a bit more info on that one
first.

"..it won't change th data on the next record..." doesn't really give
me much idea as to what your data is or what is/is not happening with
it.

- how is the data in the two forms linked?
- what actions are the two forms expected to perform?
- what exactly happens with he first entry
- what exactly happens with the second?

Brett

I have a form/subform for recording orders. On the subform the product id is
a combo box(controled by a query) that displays only the products that are
ordered by the customer in the customer id field on the main form. It works
fine on the first record I enter, but the problem is it woun't change the
data on the next record unless you leave the form and come back. Any
suggestions?

Cheers,
Brett
 
G

Guest

Brett
Thank you for responding to my question.
The main form is frmPriOrders and is controlled by qryOrders, and contains
customer name, invoice numbers and dates. The sub form isfrmSubOrders and is
controlled by qryOrderDetailExtended, and contains the products that are
ordered, quantities, cost and extended cost. They are linked one to many by
the OrderID, which is set to autonumber. The purpose for the form is to
record each order, which customer ordered, what they ordered and when they
ordered it. On the main form there is a combo box CustomerID, which is
sourced to tblCustomer. On the sub form is a combo box ProductID, which is
sourced to qryProductOrders. This query is supposed to show only the
products that pertain to the customer in the CustomerID combo box.
I have the order form set to open in a new record, when I open the order
form and enter data the ProductID combo box works the way I want it to. If I
have multiple orders to enter, from different customers, this is where the
problem lies. After the first order is entered and I select a new record,
the ProductID combo box shows the products from the first customer. In order
for the form to work the way I want I would have to exit the form after each
Order was entered. I have tried to refresh the form and I’ve tried to run a
requery macro in the afterupdate event of the CustomerID combo box. Nothing
works.
Thanks
Brian
 
G

Guest

Brett
Thank you for responding to my question.
The main form is frmPriOrders and is controlled by qryOrders, and contains
customer name, invoice numbers and dates. The sub form isfrmSubOrders and is
controlled by qryOrderDetailExtended, and contains the products that are
ordered, quantities, cost and extended cost. They are linked one to many by
the OrderID, which is set to autonumber. The purpose for the form is to
record each order, which customer ordered, what they ordered and when they
ordered it. On the main form there is a combo box CustomerID, which is
sourced to tblCustomer. On the sub form is a combo box ProductID, which is
sourced to qryProductOrders. This query is supposed to show only the
products that pertain to the customer in the CustomerID combo box.
I have the order form set to open in a new record, when I open the order
form and enter data the ProductID combo box works the way I want it to. If I
have multiple orders to enter, from different customers, this is where the
problem lies. After the first order is entered and I select a new record,
the ProductID combo box shows the products from the first customer. In order
for the form to work the way I want I would have to exit the form after each
Order was entered. I have tried to refresh the form and I’ve tried to run a
requery macro in the afterupdate event of the CustomerID combo box. Nothing
works.
Thanks
Brian
Renegade9797 said:
I have a form/subform for recording orders. On the subform the product id is
a combo box(controled by a query) that displays only the products that are
ordered by the customer in the customer id field on the main form. It works
fine on the first record I enter, but the problem is it woun't change the
data on the next record unless you leave the form and come back. Any
suggestions?





Manage Your Profile
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks
|Privacy Statement
 

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