Main form/sub form current event

G

Guest

I can't remember if I've posted this already!! :( Sorry if I have, I can't
find it.

I have a main form (frmFollow) with a subform (frmProducts). Fields in
frmProducts are disabled on the value (8) of an option group. There is code
to manage this in the subform oncurrent event and the afterupdate event of
the option group. When I open the form to a record with an option group value
of 8, everything appears correctly. When I find another record with the same
value (8), everything appears correctly. When I cycle thru the subform
records (using previous and next buttons) within a main form record,
everything appears correctly. HOWEVER, when I cycle thru main form records,
the disabling disappears! I had assumed that the subform on current event
would fire when the main form records were cycled. But obviously it's not! I
have tried putting similar code in the on current event of the main form, but
that didn't work. I have tried refresh and requery on my Previous and Next
buttons on the main form, that didn't work either.

Does anyone have any suggestions about how I can manage this?

TIA
 
W

Wayne Morgan

Are the subform control's Parent and Child link fields filled in?

To refer to controls on a subform from the main form, the syntax would be:

Me.NameOfSubformControl.Form.ctlNameOfControlOnSubform.

The subform control is a container control on the main form. This control is
what holds the subform and is where you set the Parent and Child link field
properties to "tie" the main and sub forms together.
 

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