Changing row sources on a Continuous Form

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I was curious if any of the experienced programmers have
any tricks for this situation.

I have a continuous subform, and on this subform are two
dropdown boxes. For the sake of this example, we'll say
the dropdown boxes are cboCustomers, and cboSales.

The rowsource of cboSales is dependent on the value that
is stored in cboCustomers.

Normally, when you select a value in cboCustomers, and
thereby change the rowsource of cboSales, all of the other
records in the subform "lose" their cboSales values. (The
data is still there, but because the values do not fit
into the rowsource of cboSales, they do not display)

Is there any way around this anomoly? Thank you very much
in advance!

-Jim
 
Jim,

Here are two approaches to this, depending on circumstances:
1. Use code on the On Enter event of cboSales to set its RowSource
property to the query you are presently using, i.e. the one that
restricts the list according to the entry in cboCustomers in the
current record, and then code its AfterUpdate or Exit event to set the
RowSource back again to the full Sales list.
2. Have the RowSource of cboSales set to a Union Query, which combines
the records as returned by your present RowSource query, with the
Sales data from the other records already in the subform.

- Steve Schapel, Microsoft Access MVP
 
Back
Top