Problems accessing a subform control...

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I have a form on which I have a subform that has a control who's "visible"
property I want to set on load of the main form.

I have tried the following syntax but I keep getting an error stating it
cannot find the form I am referring to...

Main Form Name: frmPricing
Sub Form: frmMenuItems
Control Name: lbNext1

Here's my syntax to set the lblNext1 property...

'Forms![frmPricing]![frmMenuItems].Form.lblNext1.Visible = True

The error I get is ....

"Microsoft Access can't find the form 'frmMenuItems' referred to in a macro
expression or Visual Basic code."

Any help would be most appreciated...

Thanks,

Brad
 
Brad Pears said:
I have a form on which I have a subform that has a control who's
"visible" property I want to set on load of the main form.

I have tried the following syntax but I keep getting an error stating
it cannot find the form I am referring to...

Main Form Name: frmPricing
Sub Form: frmMenuItems
Control Name: lbNext1

Here's my syntax to set the lblNext1 property...

'Forms![frmPricing]![frmMenuItems].Form.lblNext1.Visible = True

The error I get is ....

"Microsoft Access can't find the form 'frmMenuItems' referred to in a
macro expression or Visual Basic code."

Any help would be most appreciated...

Thanks,

Brad

Most likely, the name of the subform control -- the control on the main
form that is displaying the form named "frmMenuItems" -- isn't actually
"frmMenuItems". Check the name of that control, and use it in place of
"frmMenuItems" in your reference.
 
You got it - that was the problem!!!

Thanks
Dirk Goldgar said:
Brad Pears said:
I have a form on which I have a subform that has a control who's
"visible" property I want to set on load of the main form.

I have tried the following syntax but I keep getting an error stating
it cannot find the form I am referring to...

Main Form Name: frmPricing
Sub Form: frmMenuItems
Control Name: lbNext1

Here's my syntax to set the lblNext1 property...

'Forms![frmPricing]![frmMenuItems].Form.lblNext1.Visible = True

The error I get is ....

"Microsoft Access can't find the form 'frmMenuItems' referred to in a
macro expression or Visual Basic code."

Any help would be most appreciated...

Thanks,

Brad

Most likely, the name of the subform control -- the control on the main
form that is displaying the form named "frmMenuItems" -- isn't actually
"frmMenuItems". Check the name of that control, and use it in place of
"frmMenuItems" in your reference.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top