• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 498
  • Last Modified:

reference subform visible property in vba

I have a frmDecodeResult (it isnt open at this stage) on this form are subforms FrmAbiColumnOut I want to reference the subforms visible property and change it within vba:

I have done this:

Forms!FrmDecodeResult.FrmAbiColumnOut.Form.Visible = False

but it squeels and says error 2450 cannot find frmdecoderesult.

help would be appreciated
0
PeterBaileyUk
Asked:
PeterBaileyUk
4 Solutions
 
Rey Obrero (Capricorn1)Commented:
is the form "FrmDecodeResult" open when you got the error?
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I have a frmDecodeResult (it isnt open at this stage)
You can't make these changes unless the form is open, in either Design or Normal view.
0
 
Dale FyeCommented:
Obviously, you cannot refer to the subforms visible property if the form it is on is not open, but when it is open, you have to refer to the subform control on the main form

Forms!FrmDecodeResult.FrmAbiColumnOut.Visible = False
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Two things:

1. You always want to refer to the subform control's name, not the name of the subform (they may not be one in the same).

2. It's the subform control that you want to hide on the main form, not the subform itself.

Jim.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
you have to refer to the subform control on the main form
You can do it either way ... although setting the Visible property of the Subform's Form is somewhat redundant :)
0
 
PeterBaileyUkAuthor Commented:
ok i will do this operation on form open thx
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now