Solved

reference subform visible property in vba

Posted on 2014-09-10
6
425 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

813 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

17 Experts available now in Live!

Get 1:1 Help Now