subform combo box update, access 03

T

tecas

I have a form with 2 subforms. The main form has a combo box
Department. The subforms contain combo boxes with lists dependant upon
the main form's Department choice. How do I requery the lists of the
subform combo boxes?

Private Sub DepartmentOrValueStream_Change()
Me.cboMachineOrWorkcenter.Requery
Me.frmScrap_Subform.cboscrapchar.Requery
Me.frmScrap_Subform.cboscrapdefect.Requery
Me.frmScrap_Subform.cboscrapcause.Requery
Me.tblDownTime_Subform.cboDTCode.Requery
End Sub

The combobox on the main form updates fine but I receive a compile
error whenever I try to update a combo box in either of the subforms.
Any help would be greatly appreciated.


Thanks,
Ted
 
B

Brendan Reynolds

tecas said:
I have a form with 2 subforms. The main form has a combo box
Department. The subforms contain combo boxes with lists dependant upon
the main form's Department choice. How do I requery the lists of the
subform combo boxes?

Private Sub DepartmentOrValueStream_Change()
Me.cboMachineOrWorkcenter.Requery
Me.frmScrap_Subform.cboscrapchar.Requery
Me.frmScrap_Subform.cboscrapdefect.Requery
Me.frmScrap_Subform.cboscrapcause.Requery
Me.tblDownTime_Subform.cboDTCode.Requery
End Sub

The combobox on the main form updates fine but I receive a compile
error whenever I try to update a combo box in either of the subforms.
Any help would be greatly appreciated.

Try explicitly using the Form property of the subfrom control, for example
....

Me.frmScrap_Subform.Form.cboscrapchar.Requery
 
T

tecas

Try explicitly using the Form property of the subfrom control, for example
...

Me.frmScrap_Subform.Form.cboscrapchar.Requery

Thanks, works like a charm. My second try was
me.form.frmscrap_subform.cboscrapchar.requery. This, of course works
much better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top