Solved

reference subform visible property in vba

Posted on 2014-09-10
6
412 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
6 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
is the form "FrmDecodeResult" open when you got the error?
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
Comment Utility
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 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 125 total points
Comment Utility
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 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 125 total points
Comment Utility
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 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
Comment Utility
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
Comment Utility
ok i will do this operation on form open thx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now