Solved

Hiding Fields in Access 2007 SubForm

Posted on 2014-02-24
6
881 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
[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
  • 3
  • 3
6 Comments
 
LVL 38

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 38

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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

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 38

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

635 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