Open sub form to a specific record

hardy1976

Still learning...
Local time
Today, 01:41
Joined
Apr 27, 2006
Messages
200
Hi,

I have a form that lists a number of orders (list box).

I have another form that has customer details as the main form and the order as a sub form and then another sub form for items....

How can I open the sub form to a specific record? ie I want to view order 14?
 
use the linkchild linkmaster properties of your subform.

set the linkchild property to the name of the field in your subform - probably something like ordered

set the linkmaster property to the name of your listbox - assumes that orderid is the bound column
 
CJ Thanks.

What I'm trying to do is...

I am on form 1 - which lists orders (in a list box)....
I want to edit that order, The edit orders form is currently another form. therefore I want to go straight to customer Joe Blogs and order 5 (note he has 100 orders) - so I can edit it.

Using the linkchild i will retrieve all 100 orders wont it?
 
The edit orders form is currently another form. therefore I want to go straight to customer Joe Blogs and order 5 (note he has 100 orders) - so I can edit it.
In that case suggest you use the openarg parameter of docmd.openform (you may need to close it first if already open) to pass the orderID

Then in your customer form you will need some code in the form open event to filter the main form for the customer (perhaps using dlookup to find the customer associated with the order passed as the openarg) then to filter the subform in some way to filter to the required order
 

Users who are viewing this thread

Back
Top Bottom