472,782 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 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 12005
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.