Solved

Show/Hide Columns in Subform

Posted on 2014-04-14
3
572 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 48

Expert Comment

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

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

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

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

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.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

627 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