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!
3 5973 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: - 'Want to view SubFormTwo
-
Me!SubFormOne.Visible = False
-
Me!SubFormTwo.Visible = True
-
Me!SubFormThree.Visible = False
-
Me!SubFormFour.Visible = False
-
Me!SubFormFive.Visible = False
-
Me!SubFormSix.Visible = False
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. -
Private Sub cmdSubForm1_Click()
-
Me.sfrm.SourceObject = "sfrm1"
-
End Sub
-
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. -
Private Sub cmdSubForm1_Click()
-
Me.sfrm.SourceObject = "sfrm1"
-
End Sub
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 what point when learning C++
was I supposed to have picked up STL? I ask because at every
job I've had, and every job interview for that matter, whenever
STL comes up it's not I, but a manager who says effectively
yuck, we don't use that crap.
|
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 IE so I drew conclusions only to
discover that it worked even with <a name="xtop"></a>
but not in Opera. IE6 understands "top" to mean *the top* !
|
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 does not.
|
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">
|
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 seem to think
so. According to my colleague, if the data structure does not "deep
copy" issues, it is perfectly okay to return a local variable. This is
because at the point of invocation, a copy of the data structure is
made.
In all fairness...
| |
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 the heap is slow or something, and I
have no idea why that would be.
Joe
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |