Solved

Show/Hide Columns in Subform

Posted on 2014-04-14
3
558 Views
Last Modified: 2014-04-14
This is probably something mind-blowingly simple (or so I hope) but my brain is fried right now and I'm asking for an assist...

Have three forms:
FormS1
FormW1
FormSub

FormSub is a form subform in BOTH FormS1 and FormW1.  

In FormS1, I need ALL fields of FormSub displayed in a Datasheet view.
In FormW1, I need TWO fields of FormSub HIDDEN in the datasheet view.

How do I either:
Detect which form is the parent from FormSub (then I can easily use ColumnHidden = True/False)
*OR*
Set the fields' ColumnHidden value in FormSub to True/False FROM the parent form.

I cannot seem to figure out how to reference the form!  I would have thought Form!FormSub.Field.ColumnHidden = True or Me!FormSub.Field.ColumnHidden = True but that doesn't seem to be working for me...

your assistance is greatly appreciated.
0
Comment
Question by:Lee W, MVP
3 Comments
 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 500 total points
ID: 39998425
I think it is
Form!formName!SubformName.Form!columnName.ColumnHidden = True (if it will allow that to happen)

Kelvin
0
 
LVL 95

Author Closing Comment

by:Lee W, MVP
ID: 39998478
Using some trial and error and inspiration from your comment and a sudden rememberance of my own debugging skills, I ended up with the following that worked:

Me![Sub Form Name].Form!SubForm2.Form.ColumnName.ColumnHidden = True

Convoluted and I would have preferred Access recognize things... but it didn't.

Thanks for the inspiration.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39998724
you could probably have used the subforms Load event with something like:

me.ColumnName.ColumnHidden = (me.parent.Name = "FormW1")
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

792 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