Refresh a combo box on a sub-form

D

Dennis

Hi,

While in the main form, I want to requery / refresh a combo box on a
sub-form. Ive read a couple of forum discussion concerning this issue and
tried them, but it did not work. I'm doing somthing dumb.


My main form name is frmFamily
My sub-form name is frmFamily-sfMembers
The name of the combo box on the frmFamily-sfMembers is cboMemNo

While in the main form, I want to have Access requery cboMemNo on the
frmFamily-sfMembers.


While in the main form, I've tried:

Me!frmFamily-sfMembers.Form!cboMemNo.Requery

This results in the error message "Access can't find the field
'frmFamily-sfMembers' referred to in your expression.

I also tried:

Me.frmFamily-sfMembers.Form.cboMemNo.Requery

This resulst in the error message "method or data member not found".


I also tried:

Me![frmFamily-sfMembers].Form!cboMemNo.Requery

Which resulted in can't find the field "Access can't find the field
'frmFamily-sfMembers' referred to in your expression.


What am I doing wrong?


Thank you for your assitance.


Dennis
 
D

Dennis

Brue, Daryl,

Bruce,

Thank you for suggesting that I check the name of the subform control. That
was part of the problem.

I tried:

Me.frmFamily-sfMembers.cboMemNo.Requery

and the produced an error, so I tried:

Me.frmFamily-sfMembers.Form.cboMemNo.Requery

and that worked. Just for safely, I did put [] around the form name in my
final version and that worked also.

Thank you for your assitance. My form works great and I learned a little
more today!


Dennis
 

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