Solved

Hiding Fields in Access 2007 SubForm

Posted on 2014-02-24
6
805 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 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

13 Experts available now in Live!

Get 1:1 Help Now