473,499 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overlapping subforms - bringing any one to "top of the stack"

Walt in Decatur
20 New Member
I have set up a bunch of subforms to appear in the same spot on the screen relative to the main form. I have set up command buttons with open and close each subform. However, if I have several open at the same time, only the one that is "later" in the order of controls shows, the others sit underneath and one can't set focus on them.

First question. Design-wise, I like the way I've set this up, as one can expect a subform to always pop up in the same spot. But is this a good idea?
Second question. What would be the code for a command button to bring any particular subform to the top, in front of others? Can this be done easily regardless of how many subforms are open at any given time?

Thanks, oh wise Access gurus!
Jun 15 '07 #1
3 5920
ADezii
8,834 Recognized Expert Expert
I have set up a bunch of subforms to appear in the same spot on the screen relative to the main form. I have set up command buttons with open and close each subform. However, if I have several open at the same time, only the one that is "later" in the order of controls shows, the others sit underneath and one can't set focus on them.

First question. Design-wise, I like the way I've set this up, as one can expect a subform to always pop up in the same spot. But is this a good idea?
Second question. What would be the code for a command button to bring any particular subform to the top, in front of others? Can this be done easily regardless of how many subforms are open at any given time?

Thanks, oh wise Access gurus!
Let's assume you have 6 stacked Sub-Forms, and you wish to view SubFormTwo. Just set its Visible Property to True and the rest to False, something similar to the code below:

Expand|Select|Wrap|Line Numbers
  1. 'Want to view SubFormTwo
  2. Me!SubFormOne.Visible = False
  3. Me!SubFormTwo.Visible = True
  4. Me!SubFormThree.Visible = False
  5. Me!SubFormFour.Visible = False
  6. Me!SubFormFive.Visible = False
  7. Me!SubFormSix.Visible = False
Jun 15 '07 #2
JKing
1,206 Recognized Expert Top Contributor
If you don't need more than one of the subform open at any one time you could just as easily flip the sourceobject each time you want a different form to appear. This means only having one subform pane on your main form instead of stacking 6 subforms on the same form. All you would have to do is put the correct subform name in for each button click event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSubForm1_Click()
  2. Me.sfrm.SourceObject = "sfrm1"
  3. End Sub
  4.  
Jun 18 '07 #3
Walt in Decatur
20 New Member
Bingo! Thanks!

This is the way I chose to implement it (now that I got back to working on my form). I think it's the simplest way, indeed. I probably should have thought of this in the first place, but I'm still learning how to exploit properties of various controls to my advantage. Not having any formal training makes for interesting adventures in coding. :-)

If you don't need more than one of the subform open at any one time you could just as easily flip the sourceobject each time you want a different form to appear. This means only having one subform pane on your main form instead of stacking 6 subforms on the same form. All you would have to do is put the correct subform name in for each button click event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSubForm1_Click()
  2. Me.sfrm.SourceObject = "sfrm1"
  3. End Sub
  4.  
Jul 10 '07 #4

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

Similar topics

87
5109
by: ziliath | last post by:
I recently tried out the Google "top coder" contest, as a C++ coder. I noticed immediately that they expected me to know STL. To which I say, what the fuck?! I may be missing something, but at...
19
3279
by: Mason A. Clark | last post by:
How was I to know that "top" means "top" in MSIE6 ?? I was testing <a name="top"></a> at the top of the page with <a href="#top>go to top</a> at the bottom of the page. It always worked in...
6
7032
by: Mason A. Clark | last post by:
LAST WORD(s): 1. MSIE6 and Firefox will go to the top of the page on command <a href="#top">go upsy</a> even if there is NO name="top" or id="top" They know what a "top" is :-) Opera...
16
4419
by: Gufus | last post by:
Hi Group... <a name="#top"></a> ----del---- ----del---- <img SRC="images/top.gif" USEMAP="#top" BORDER=0> <map NAME="top">
6
2405
by: Generic Usenet Account | last post by:
Is it okay to return a local datastructure (something of type struct) from a function, as long as it does not have any pointer fields? I think it is a bad idea, but one of my colleagues does not...
15
6702
by: Joe Van Dyk | last post by:
Can someone explain what a heap and what a stack is? And why I should care? I used to know, but then I forgot. And I can't seem to find it in the C++ FAQ. I keep reading how allocating from...
0
7131
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
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.