473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Show/hide Subform

I am building a form. The main form will be more of a switch board with summary information related to one project.

Each project has 3 main categories. So the summary would look something like this:
item 1 Item 2 Item3
Cat 1 100 20 5
Cat 2 1000 100 0
Cat 3 0 5 50

Where
Item 1 is the goal
Item 2 is the current
Item 3 is the projected

Each Category then has a set of Sub Categories

What I would like to do is have the user click on the label for Cat 1 (ECT) and have a subform show that has the Sub Items for Cat 1. On the SubForm would be a button to hide the subform


So basically I need a way to set the visible property of a subform to true from the main form. And then set it to false from with in the subform.
Mar 29 '07 #1
10 12054
Rabbit
12,516 Expert Mod 8TB
The absolute path to the property of a control on a form is:
[Forms]![Form Name]![Control Name].propertyname
Mar 29 '07 #2
Thank you for fast reply


So for my test I have

Form 1 = MainForm
Form 2 = BlankForm

Form 2 is embeded in Form 1 as a SubForm

In the OnClick Event of Label 1 I set the code to

[Forms]![MainForm].[BlankForm]![Visible] = True

And in the subform in a command button I set the On Click to

[Forms]![MainForm].[BlankForm]![Visible] = False

Leaving out all brackets

Is that the gest?
Mar 29 '07 #3
Rabbit
12,516 Expert Mod 8TB
That's the gist. But you have to flip the . and the last !
In your case you can leave off the brackets, the brackets are used when you have unconventinonal Form names likes names with a space in it or some non-alphanumeric character.
Mar 29 '07 #4
AccessIdiot
493 256MB
So you can set whole forms/subforms to visible or not? I thought you could only cycle through the controls on a form/subform and set their visible properties to true/false.
Mar 29 '07 #5
I know this is going to be simple.

I keep getting the same error.
"The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Office Access was communicating with the OLE server or ActiveX Control."

Here is the code I used.

Private Sub Label18_Click()
Forms!MainJobCostWindow!BlankForm.Visible = True
End Sub
Mar 29 '07 #6
Rabbit
12,516 Expert Mod 8TB
So you can set whole forms/subforms to visible or not? I thought you could only cycle through the controls on a form/subform and set their visible properties to true/false.
I assume you can. For a subform at least, not the main form. I see no reason why you can't.
Mar 29 '07 #7
Rabbit
12,516 Expert Mod 8TB
I know this is going to be simple.

I keep getting the same error.
"The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Office Access was communicating with the OLE server or ActiveX Control."

Here is the code I used.

Private Sub Label18_Click()
Forms!MainJobCostWindow!BlankForm.Visible = True
End Sub
Hmm.. should work. I just tested it, albeit with a command button but in this case same difference. Where's the Label18 located?
Mar 29 '07 #8
It is located on the main form.
Mar 29 '07 #9
Rabbit
12,516 Expert Mod 8TB
Check your library references and make sure they're all there.
Mar 29 '07 #10
Just curious, why would you want to hide a subform?

TIA (thanks in advance)
Apr 2 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ajai Kumar .R | last post by:
Hai all, I've two or more forms on my app. My requirement is, Have to show the first form asa the user press a button have to hide the first form and show the second form. If the user press the...
10
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
3
by: alex | last post by:
I'd like to have a show/hide widget on my web site, kind of like "show details" / "hide details" in Google Groups. Is there a tutorial explaining how to make them? Google's is a bit complex and...
4
by: bridgemanusa | last post by:
Hi All: I have a very long page of html that I want to take portions and hide them in divs, then show when a link is clicked. I have the hide show part working when the link is clicked, however...
7
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
3
by: | last post by:
I'm using the DataList and GridView controls, and I am trying to wrap my head around the problem of conditionally showing or hiding cells/cell content based on the presence or absence of DB data. I...
1
by: asilverpeach | last post by:
Hey Guys! Found some great scripts here on this topic but have to make to changes to the code that I can't seem to figure out. First, In the following code clicking on the headers shows the...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
18
by: ryrocks | last post by:
Hi, Im making a 'contact us' page. The user click on the div, this then reveals another larger div displaying more information giving the effect of the box expanding or dropping down. I have 3...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.