D
Dave
I have a form, say orders, and a subform, say parts.
I want the subform to display as a pick list. IOW I want it to display all
the parts not just the ones currently assigned to that order.
The easy way to do this is to just link the form and subform on the orderid
and use drop down boxes on the subform for the associated parts.
But I do not want to display drop down boxes, I want to see a scrollable
list with ALL parts Those parts that are currently assigned to the order
will have a marked checkbox.
I can get close to what I want todo by using the following query as the
recordsource of the subform:
SELECT partid, a.orderid, partname
FROM parts LEFT JOIN (SELECT partid, orderid FROM order_parts WHERE
orderid = txtorderid) AS a ON a.partid=parts.partid
This gives me a list of all parts in the database and those assigned to ths
particular order will have a non-NULL orderid value.
I embed this subform in the main for and set the subform's recordsource with
DAO based on the order displayed in the main form.
But the problame is, if I set the main form's recordsource as the orders
table, the subform gets filtered. In other words, the only records that
display are the ones assigned to that order. This filtering persists even
if I remove the values in the Link Child and Master field properties.
If I remove the main form's recordsource and select an order based on a drop
down box, the subform will display all parts (checked and unchecked) as I
desire (i.e. no filtering of parts based on the orderid),
So I guess my basic question is, what is cause this linkage between main and
sub forms and how can I break it?
I want the subform to display as a pick list. IOW I want it to display all
the parts not just the ones currently assigned to that order.
The easy way to do this is to just link the form and subform on the orderid
and use drop down boxes on the subform for the associated parts.
But I do not want to display drop down boxes, I want to see a scrollable
list with ALL parts Those parts that are currently assigned to the order
will have a marked checkbox.
I can get close to what I want todo by using the following query as the
recordsource of the subform:
SELECT partid, a.orderid, partname
FROM parts LEFT JOIN (SELECT partid, orderid FROM order_parts WHERE
orderid = txtorderid) AS a ON a.partid=parts.partid
This gives me a list of all parts in the database and those assigned to ths
particular order will have a non-NULL orderid value.
I embed this subform in the main for and set the subform's recordsource with
DAO based on the order displayed in the main form.
But the problame is, if I set the main form's recordsource as the orders
table, the subform gets filtered. In other words, the only records that
display are the ones assigned to that order. This filtering persists even
if I remove the values in the Link Child and Master field properties.
If I remove the main form's recordsource and select an order based on a drop
down box, the subform will display all parts (checked and unchecked) as I
desire (i.e. no filtering of parts based on the orderid),
So I guess my basic question is, what is cause this linkage between main and
sub forms and how can I break it?