473,799 Members | 3,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSACCESS 2003 : How to use command buttons to display different subforms

1 New Member
MSACCESS 2003 : How to use command buttons to display different subforms

I have an application that display information about Pipelines and these pipelines have many other equipments attached to them like ‘Valves’, ‘Tanks’, ‘Pumps’, etc.

In this application I display using Access form, all details about a selected Pipeline. And I included in this form, a sub-form which display valves information by default.

What I would like to do is to create several buttons that once any one get clicked, will somehow replace the subform displayed and replace with another one subform. All subforms are have the same parent/child field link.

I tried to the change the SourceObject using OnClick events for the Buttons but no luck.
Sep 5 '07 #1
1 1789
barry07
47 New Member
Seems to me the simplest solution is to stack the 3 forms one on top of the other, and make the required one visible when the button is clicked.

e.g

Expand|Select|Wrap|Line Numbers
  1. Private Sub Button2_Click()
  2. subform1.visible=False
  3. subform2.visible=True
  4. subform3.visible=False
  5. End sub
The code for the other bittons will be identical except that a different subform will have visible=True.

Set the default condition (I'm assuming this is subform1 visible) in the FormOpen event:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. subform1.Visible = True
  3. subform2.Visible = False
  4. subform3.visible=False
  5. End Sub
Hope this helps
Sep 5 '07 #2

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

Similar topics

15
11559
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to MSACCESS.EXE, tries them all, takes the first one it finds, and dies if none is found. Seems to me like at some time or another I was able to clone this .BAT file and implement it with no path. Something about MSACCESS being a registered application.
10
2416
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ComboBox.SelectedValue = db_value; If the db_value was not included in the ComboBox value list the ComboBox.SelectedIndex used to return -1, Now the very same code is
14
4975
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the tab order?
1
2882
by: keliie | last post by:
Hello, I've created a form that contains a single unbound combo box and two subforms. The two subforms display the results of a query (driven by the combo box selection) in both tabular and pivot chart formats. The problem that I'm having is that the Pivot Chart that I've created rounds all of the values down to the nearest integer (e.g., 1.9 is rounded to 1.0, 0.6 is rounded to 0). As you can guess, this is a serious issue when I'm...
2
5227
by: emc_cos | last post by:
I have a very nice parent child relationship happening between a main form and 8 subforms. The main form is the data entry point for a table that holds textual data like names, notes and the like. It also holds the primary key which is an alpha-numeric file designation. The subforms are the data entry point for another table that holds numeric values for time spent on tasks.
3
2007
by: Icemokka | last post by:
Hi, I've got a table in MsAccess with 100+ fields. If I fill a tabletable with this table , change some values , get the update-command via commandbuilder , the update fails. This because the commandbuilder adds a where clause that contains all the fields in the datatable ( to check whether the record has been changed since the fill ). Because MSAccess does not allow more then 99 fields in the where clause, the update fails offcourse.
3
1869
by: Gary | last post by:
Afternoon Is it possible to display test alongside the Navigation Buttons in an MS Access form? I have a complex form containing a number of subforms where the Navigation Buttons are relatively adjacent. Users are getting confused as to which Navigation Button they are selecting, so adjacent text would help.
3
4476
by: louisjones | last post by:
Hi all I have a form with a few subforms. I want to set the subforms to 'not visible' and open each in an individual popup window from command buttons. If anyone knows a better way of opening multiple subforms from buttons rather than having them all 'open' at once on a large form then please let me know! I can't work it out! Thanks
9
4500
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd like to know is the stability, speed & ease of use of both the products. I believe Access 2007 has a new file format too and that it may be slower.
0
9546
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,...
0
10491
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, 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...
0
10031
tracyyun
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...
1
7571
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 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...
0
6809
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
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
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.