Solved

Show/Hide Columns in Subform

Posted on 2014-04-14
3
565 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
[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 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 96

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…

751 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