Syntax problem

  • Thread starter Thread starter gr
  • Start date Start date
G

gr

Hello,
which is the right syntax of the following?

dim frm as Form
Set frm = Forms("frmMD!sfrmMeasurementDevices")

I have tried with

Set frm = Forms("sfrmMeasurementDevices")

and

Set frm = Forms("Forms!frmMD!sfrmMeasurementDevices")

no luck yet..

thx.
 
Hi gr

Try:
Set frm = Forms("frmMD").Controls("sfrmMeasurementDevices").Form

or, you can abbrevate this to:
Set frm = Forms!frmMD!sfrmMeasurementDevices.Form

Note that here, sfrmMeasurementDevices is not a Form object, but a
*subform control*, which contains a form, accessible via its Form property.
 
Back
Top