Solved

Hiding Fields in Access 2007 SubForm

Posted on 2014-02-24
6
821 Views
Last Modified: 2014-02-26
I have an Access 2007 form, that contains a sub-form, and I would like to hide a field that is part of the sub-form.  I have the field defined on the sub-form because it is retrieved as part of a query that is used to populate the sub-form.  I need the field there to serve as an index to another table, if someone clicks / double clicks on a line on the sub-form.  I have set the field as Visible --> NO, but that doesn't seem to do it.

Any help would be appreciated.

Thanks..Tom
0
Comment
Question by:tpigielski
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:PatHartman
ID: 39883432
Setting the visible property to No is the correct method if you never want the control to be visible.  Do you have code that is resetting the .visible property?
0
 

Author Comment

by:tpigielski
ID: 39883962
I'm not using any code...I'm just setting the control properties in the "properties" window for the control
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 39884001
There are two form views.  Form View and Layout View.  The field should be hidden in Form View and visible in Layout View.

I make the background of my "hidden" fields something bright and obnoxious like yellow.  That way, they stand out like a sore thumb if they are unhidden for some reason.
0
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.

 

Author Comment

by:tpigielski
ID: 39886825
Perhaps I wasn't clear enough in my explanation, but this is what I needed to do to make the fields hidden:

    Forms!frmsearchforperson!StudentListSubform.Form.Student_ID.ColumnHidden = True
    Forms!frmsearchforperson!LeadsListSubform.Form.Customer_ID.ColumnHidden = True

Tom
0
 

Author Comment

by:tpigielski
ID: 39888737
I've requested that this question be closed as follows:

Accepted answer: 0 points for tpigielski's comment #a39886825

for the following reason:

Other answers did not solve my problem
0
 
LVL 34

Accepted Solution

by:
PatHartman earned 400 total points
ID: 39887299
If you had told us the subform was a datasheet view, we might have been able to answer the question.  Datasheet forms work differently from other form types.

Also, FYI, the field doesn't have to be bound to a control on the subform in order to be usable in VBA.  Only reports require the fields to be bound to controls and that is only because behind the scenes, Access rewrites your report RecordSource and eliminates all columns that are not bound to controls.
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

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…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

914 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

14 Experts available now in Live!

Get 1:1 Help Now