?
Solved

reference subform visible property in vba

Posted on 2014-09-10
6
Medium Priority
?
471 Views
Last Modified: 2014-09-10
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
Comment
Question by:PeterBaileyUk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40314378
is the form "FrmDecodeResult" open when you got the error?
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 total points
ID: 40314384
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
 
LVL 48

Accepted Solution

by:
Dale Fye earned 500 total points
ID: 40314398
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40314413
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
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 total points
ID: 40314432
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
 

Author Closing Comment

by:PeterBaileyUk
ID: 40314441
ok i will do this operation on form open thx
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question