| | |
|
|
|
Populate subform datasheet combobox from mainform tab control combobox |
| message from =?Utf-8?B?dHN0dXZl?= on 21 May 2004 |
Hi,
I have a product combobox that is part of a subform datasheet embedded in a tab control on the main form. I would like it to be populated based on a selection from a subcategory combobox that sits on the main form's tab control.
I can't get it to populate correctly, but when you try to add another record in the datasheet, the product list doesn't change. If I change the subcategory selection, the product list is is the same as in the first record.
Any ideas??
Thanks in advance.
|
| Sandra Daigle replied to =?Utf-8?B?dHN0dXZl?= on 22 May 2004 |
- The AfterUpdate event of the subcategory control
- The Current Event of the main form
In order to requery a control on the subform using code in the main form,
you must also reference the subform control. If the subform control is named
sfrmSub1 and the control on the subform is named cboProductId then from the
class module of the main form the correct way to requery this control would
be:
me.sfrmSub1.form.cboProductid.requery
Note that 'sfrmSub1' must be the name of the subform control on the main
form. This is not necessarily the same as the name of the form object that
is referenced in the ControlSource of the subform control. To be sure, open
the main form and click once on the subform then check the name property
under the Other tab. Whatever you find there is what belongs in place of
sfrmSub1.
|
|
Archived message: Populate subform datasheet combobox from mainform tab control combobox (Microsoft Access Forms)