Can't find the field 'frm_Test2" referred in your expression.

  • Thread starter Thread starter bsm
  • Start date Start date
B

bsm

Hi,

This question was asked many times and answered too. But none of them
rectify my issue. Plz help me.

In my parent form I have two sub forms. In Button click event of Main
Form I am accessing the Sub Form Control value. But it doesn't work.

Debug.Print Forms!frm_MainForm.Controls!frm_Test2!VS_Type.Value

Where frm_MainForm is the Parent form, frm_Test2 is sub form and
VS_Type is control of the sub form.

It is very urgent.
 
That should be

Forms!frm_MainForm!frm_Test2.Form.VS_Type

(a . before Form, not a !)

Also, make sure that the name of the subform control on frm_MainForm is
actually frm_Test2. Depending on how frm_Test2 was added as a subform, the
name of the subform control may be different than the name of the form being
used as a subform. It's the name of the control you want.
 
Hi Doug,

You are right i will be punishing myself for that one... Thanks for the
correction.
 
Back
Top