Link to home
Start Free TrialLog in
Avatar of tpigielski
tpigielski

asked on

Hiding Fields in Access 2007 SubForm

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
Avatar of PatHartman
PatHartman
Flag of United States of America image

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?
Avatar of tpigielski
tpigielski

ASKER

I'm not using any code...I'm just setting the control properties in the "properties" window for the control
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.
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
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
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial