Hi I'm a newbie. Recently I'm trying hard to figure things out in Access. I've made a form named Order and inside it is a sub-from with the name order_details. I have a combobox with all the order numbers displayed. Now, when my form first loads combobox is selected to nil and nothing is displayed in the order_details subform. But as I select order number in the combo box I want order_details to be updated with all the details of that particular order number. Below is the Order table:
Order:
----------------------------------
OrderNbr | OrderDate | CustomerID
----------------------------------
O1001 | 2006-05-10 | 1
O1002 | 2006-06-05 | 2
O1003 | 2006-06-15 | 3
Customer:
----------------------------
CustomerID | CustomerName
----------------------------
1 | John
2 | Hary
3 | Smith
How I'm trying to achieve it now is I've written one query and saved it as subformquery and while making order_details subform I have selected all the fields from this query by selecting "Use existing tables and queries". Later I edited this query with this at the end:
"WHERE ((OrderNbr)=[forms]![Order]![combobox]);"
And from VBA in which I'm completely dumb, I have called the after_update method as:
DoCmd.OpenQuery "subformquery"
But it opens a new dialog box where I have to put again OrderNbr and after pressing Ok it updates the subform but also opens a query output window separately. So, how can I jus update the subform without all these. Thanks.
Order:
----------------------------------
OrderNbr | OrderDate | CustomerID
----------------------------------
O1001 | 2006-05-10 | 1
O1002 | 2006-06-05 | 2
O1003 | 2006-06-15 | 3
Customer:
----------------------------
CustomerID | CustomerName
----------------------------
1 | John
2 | Hary
3 | Smith
How I'm trying to achieve it now is I've written one query and saved it as subformquery and while making order_details subform I have selected all the fields from this query by selecting "Use existing tables and queries". Later I edited this query with this at the end:
"WHERE ((OrderNbr)=[forms]![Order]![combobox]);"
And from VBA in which I'm completely dumb, I have called the after_update method as:
DoCmd.OpenQuery "subformquery"
But it opens a new dialog box where I have to put again OrderNbr and after pressing Ok it updates the subform but also opens a query output window separately. So, how can I jus update the subform without all these. Thanks.