473,416 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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

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 1772
barry07
47
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
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...
10
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) ...
14
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...
1
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...
2
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...
3
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...
3
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...
3
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...
9
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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
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...

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.