Solved

reference subform visible property in vba

Posted on 2014-09-10
6
417 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
ID: 40314378
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
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 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 125 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 57

Assisted Solution

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

Assisted Solution

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

867 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

21 Experts available now in Live!

Get 1:1 Help Now