Button to open Subform

WaterDoc

New member
Local time
Today, 04:39
Joined
Jan 4, 2012
Messages
5
I have a main form with subforms displaying information soley related to the main form record because they are linked by master and child fields. Unfortunately my main form is getting too full and I would like to open the subforms with individual buttons on the main form instead of displaying all the subforms on the main form. When I used the button wizard to open the subform, all the records in the subform are displayed and not just those soley related to the main form. There is no place for me to tell the button to link master and child fields like there is for the subform.

Is there a way to get the button to open the subform with only those records related to the main form?
 
... my main form is getting too full...
If you're saying that you're running out of 'real estate' on your Main Form, the standard approach would be to place the Subforms on the pages of a Tabbed Control, rather than opening the Subforms using a Command Button.

What exactly has driven this overcrowding of the Main Form?

Welcome to AWF!

Linq ;0)>
 
As has been suggested why not consider using a tabbed layout.

I have created an example for you to have a look at.
 

Attachments

I like the tabs but I'm a novice and haven't gotten that far down the road. I wasn't aware of that capability. Thank you! I guess it's time to read up on creating tabbed forms.
 
Here's a quick little tutorial I give people on the use of Tabbed Pages. It addresses some of the common problems experienced with them.

First thing to remember is that the Tabbed Pages are all part of a single Form; think of it as a really long Form turned on its side. Because it is all one Form, all referencing to any Control on it is done in the same manner as if they were all on one single screen. Controls on Subforms are referenced in the exact same way as they would be if the Subform were placed directly on the Form instead of on a Tabbed Page.
  1. Create a Form in Design View.
  2. Goto the toolbox and click on the Tabbed Control Icon; it actually looks like several manila file folders.
  3. Place it on your Form and adjust the size to your liking.
  4. If you need more than the two Tabbed Pages it initially gives you, click on the tabbed control to select it.
  5. Goto Insert and click on Tabbed Control Page and another tabbed page will be added. Do this as many times as necessary.
This is the really important part: when you go to add a control to a tabbed page, whether it be a textbox, command button or subform, you must first click to select one of the pages, then add the control. Otherwise, the control will be added to the Form itself, and will show thru on all tabbed pages! If a single page has been selected, when your cursor carrying the control appears over the page, a black "insert" will appear.

Once you have the Form's Control Source (your table or a query) set up, you simple add controls as you normally would, heeding the above paragraph.

Also important to understand! If you go to move a control from one part of your main Form to a tabbed page, you cannot drag and drop it! You must cut it, select the tabbed page, then paste it! And if the control has any code behind it, a GotFocus, OnClick, etc, after dropping it on the tabbed page, you'll have to "reconnect" it to its code. Select the control, goto Properties, click to the right of [Event Procedure] on whatever event to bring up the ellipsis (...) then click it to go to the code window. Exit the code editor and the control and its event code will be connected.

One last thing. When trying to access the Properties of the Tabbed Control, such as the BackStyle, people complain that they can't find the property. The problem is that they haven't selected the Tabbed Control, they've selected one of the pages of the Tabbed Control! The best way to be sure of selecting the Tabbed Control itself is to click to the right of the last tab. If you have 2 tabs, for instance, click in the blank area where Tab 3 would be, if you had a Tab 3.

Linq ;0)>
 
The tabbed subforms worked. Thanks so much for the suggestion! Boss likes it and so do the other users. Again, thank you for pointing me in the right direction.
 
Here's a quick little tutorial I give people on the use of Tabbed Pages. It addresses some of the common problems experienced with them.

First thing to remember is that the Tabbed Pages are all part of a single Form; think of it as a really long Form turned on its side. Because it is all one Form, all referencing to any Control on it is done in the same manner as if they were all on one single screen. Controls on Subforms are referenced in the exact same way as they would be if the Subform were placed directly on the Form instead of on a Tabbed Page.
  1. Create a Form in Design View.
  2. Goto the toolbox and click on the Tabbed Control Icon; it actually looks like several manila file folders.
  3. Place it on your Form and adjust the size to your liking.
  4. If you need more than the two Tabbed Pages it initially gives you, click on the tabbed control to select it.
  5. Goto Insert and click on Tabbed Control Page and another tabbed page will be added. Do this as many times as necessary.
This is the really important part: when you go to add a control to a tabbed page, whether it be a textbox, command button or subform, you must first click to select one of the pages, then add the control. Otherwise, the control will be added to the Form itself, and will show thru on all tabbed pages! If a single page has been selected, when your cursor carrying the control appears over the page, a black "insert" will appear.

Once you have the Form's Control Source (your table or a query) set up, you simple add controls as you normally would, heeding the above paragraph.

Also important to understand! If you go to move a control from one part of your main Form to a tabbed page, you cannot drag and drop it! You must cut it, select the tabbed page, then paste it! And if the control has any code behind it, a GotFocus, OnClick, etc, after dropping it on the tabbed page, you'll have to "reconnect" it to its code. Select the control, goto Properties, click to the right of [Event Procedure] on whatever event to bring up the ellipsis (...) then click it to go to the code window. Exit the code editor and the control and its event code will be connected.

One last thing. When trying to access the Properties of the Tabbed Control, such as the BackStyle, people complain that they can't find the property. The problem is that they haven't selected the Tabbed Control, they've selected one of the pages of the Tabbed Control! The best way to be sure of selecting the Tabbed Control itself is to click to the right of the last tab. If you have 2 tabs, for instance, click in the blank area where Tab 3 would be, if you had a Tab 3.

Linq ;0)>

Hi Im new to access and the forum
The above seems like the answer to how I want to set my forms up from the data I have.
I have 5 tables.
1 Customer details table then 4 tables with information in that is pertinent to each customer.
I want a main form with the customer details and then the other 4 tables in tabs as in your example waterdoc in this post.
Please can you help me? I know how to create a form but do not know how to get the other 4 tables into the main form as subforms to then put as tabs.
Using the form wizard I can only get two subforms in at a time. Which way round can I do this so that it is successful?
Thank you
Ani
 

Users who are viewing this thread

Back
Top Bottom