473,778 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding subform

Hi there, I wonder if there is a kind and knowledgeable person out
there who can help me with a sticky problem.

I have a form with a subform which shows detailed data. For
complicated reasons, which I won't go into, the detail which I require
cannot be determined programmaticall y, so I planned to have two
subforms, identical in design but with slightly different data,
dependent on a criterion in the main form. Both will sit on the form,
but exactly on top of each other, with the relevant one being visible
and the unwanted one not. However, this is not working properly. In
case (a) it is fine because the topmost (visible) form completely
covers the other one. But in case (b), where I want the bottommost
(is that a real word?) subform to show, the top one appears as a grey
box. No data, but it obscures the subform I wish to see. What am I
doing wrong?

Hope this makes sense and someone can point out the error of my ways.

Regards

Caroline Bradford
Nov 12 '05 #1
7 5282
Hide the subform that you don't want to see:

If YourCondition = True Then
Me!subFrm1.Visi ble = False
Me!subFrm2.Visi ble = True
Else
Me!subFrm2.Visi ble = False
Me!subFrm1.Visi ble = True
End If

HTH - Peter
On 12 Nov 2003 14:57:13 -0800, Caroline Bradford wrote:
Hi there, I wonder if there is a kind and knowledgeable person out
there who can help me with a sticky problem.

I have a form with a subform which shows detailed data. For
complicated reasons, which I won't go into, the detail which I require
cannot be determined programmaticall y, so I planned to have two
subforms, identical in design but with slightly different data,
dependent on a criterion in the main form. Both will sit on the form,
but exactly on top of each other, with the relevant one being visible
and the unwanted one not. However, this is not working properly. In
case (a) it is fine because the topmost (visible) form completely
covers the other one. But in case (b), where I want the bottommost
(is that a real word?) subform to show, the top one appears as a grey
box. No data, but it obscures the subform I wish to see. What am I
doing wrong?

--
No mails please.
Nov 12 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You should be setting the active subform control's Visible property to
True and the inactive subform control's Visible property to False.
- --
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP7LG2YechKq OuFEgEQKXVgCeNQ jDjXgK664CHhVdl nIuLeTnds8AnRrF
IsUc8Vg9S+EszPQ kjcXAdHFk
=6+8U
-----END PGP SIGNATURE-----

Caroline Bradford wrote:
Hi there, I wonder if there is a kind and knowledgeable person out
there who can help me with a sticky problem.

I have a form with a subform which shows detailed data. For
complicated reasons, which I won't go into, the detail which I require
cannot be determined programmaticall y, so I planned to have two
subforms, identical in design but with slightly different data,
dependent on a criterion in the main form. Both will sit on the form,
but exactly on top of each other, with the relevant one being visible
and the unwanted one not. However, this is not working properly. In
case (a) it is fine because the topmost (visible) form completely
covers the other one. But in case (b), where I want the bottommost
(is that a real word?) subform to show, the top one appears as a grey
box. No data, but it obscures the subform I wish to see. What am I
doing wrong?

Hope this makes sense and someone can point out the error of my ways.

Regards

Caroline Bradford

Nov 12 '05 #3
"Caroline Bradford" <ca************ ***@btinternet. com> wrote in message
news:eb******** *************** ***@posting.goo gle.com...
Hi there, I wonder if there is a kind and knowledgeable person out
there who can help me with a sticky problem.

I have a form with a subform which shows detailed data. For
complicated reasons, which I won't go into, the detail which I require
cannot be determined programmaticall y, so I planned to have two
subforms, identical in design but with slightly different data,
dependent on a criterion in the main form. Both will sit on the form,
but exactly on top of each other, with the relevant one being visible
and the unwanted one not. However, this is not working properly. In
case (a) it is fine because the topmost (visible) form completely
covers the other one. But in case (b), where I want the bottommost
(is that a real word?) subform to show, the top one appears as a grey
box. No data, but it obscures the subform I wish to see. What am I
doing wrong?

Hope this makes sense and someone can point out the error of my ways.

Regards

Caroline Bradford

It is quite common for people to try a number of tricks when the standard
form / subform does not work and, like you say, the details of any one
database may be too complicated to bore the newsgroup with the details.
However, without further details it is very hard to imagine 'what you are
doing wrong'. Unless someone can guess, I think you might have to post some
idea of table structure, some code and what you are trying to achieve.
Who knows, you may be able to get away with one subform and simply
programmaticall y changing its datasource.

Fletcher
Nov 12 '05 #4
Many thanks to all those who took the trouble to offer help with this.
However, I think I need to clarify the problem more precisely. I
have successfully coded the form so that only one of the subforms is
visible at any one time (dependent on the current record). If I place
the two subforms side by side, everything works fine - either the left
or right one is seen. However, this looks ugly, is a waste of space,
and confuses users as they cycle through the records. What I wanted
to do was place the subforms exactly on top of each other, so that
whichever one was visible it would appear to the user to be the same
form. This is where the problem lies. When the topmost form is the
"invisible" one, it isn't actually invisible - it appears as a
completely flat grey rectangle, obscuring the visible subform
underneath. In other words, the subform is not becoming invisible, it
is simply becoming part of the background. I can only conclude that
this is actually what Access does - the control is not invisible, it
is simply becoming a chameleon and hiding itself in the background of
the form.

Oh well, back to the drawing board!
Peter Doering <no****@doering .org> wrote in message news:<bo******* ******@ID-204768.news.uni-berlin.de>...
Hide the subform that you don't want to see:

If YourCondition = True Then
Me!subFrm1.Visi ble = False
Me!subFrm2.Visi ble = True
Else
Me!subFrm2.Visi ble = False
Me!subFrm1.Visi ble = True
End If

HTH - Peter
On 12 Nov 2003 14:57:13 -0800, Caroline Bradford wrote:
Hi there, I wonder if there is a kind and knowledgeable person out
there who can help me with a sticky problem.

I have a form with a subform which shows detailed data. For
complicated reasons, which I won't go into, the detail which I require
cannot be determined programmaticall y, so I planned to have two
subforms, identical in design but with slightly different data,
dependent on a criterion in the main form. Both will sit on the form,
but exactly on top of each other, with the relevant one being visible
and the unwanted one not. However, this is not working properly. In
case (a) it is fine because the topmost (visible) form completely
covers the other one. But in case (b), where I want the bottommost
(is that a real word?) subform to show, the top one appears as a grey
box. No data, but it obscures the subform I wish to see. What am I
doing wrong?

Nov 12 '05 #5
ca************* **@btinternet.c om (Caroline Bradford) wrote in
news:eb******** *************** ***@posting.goo gle.com:
Oh well, back to the drawing board!


In your original post you say:

************
I planned to have two subforms, identical in design but with slightly
different data, dependent on a criterion in the main form
************

If this is the case then it's quite likely that you do not need two subforms.
One subform whose recordsource is changed on changing the citerion in the
main form should be sufficient.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #6
On 13 Nov 2003 13:16:39 GMT, Lyle Fairfield wrote:
ca************* **@btinternet.c om (Caroline Bradford) wrote in
news:eb******** *************** ***@posting.goo gle.com:
Oh well, back to the drawing board!


In your original post you say:

************
I planned to have two subforms, identical in design but with slightly
different data, dependent on a criterion in the main form
************

If this is the case then it's quite likely that you do not need two subforms.
One subform whose recordsource is changed on changing the citerion in the
main form should be sufficient.


And, if not RecordSource, at least having /one/ subform control and
replacing the SourceObject should help.

Peter

--
No mails please.
Nov 12 '05 #7
I've done something similar, though for purely aesthetic reasons.
Just use a tab control and stick your subforms on 2 different pages,
using code to switch pages. Then, set the tab control to have Style =
"None" and Back Style = "Transparen t".

This also allows you to place a whole bunch of other things onto the
pages (like labels and such) without adding any more code. To add an
object to a particular page (as suppose to over top of the tab
control), you will have to cut the object, and paste it with the
appropriate page selected. To edit the individual pages, you'll have
to set Style = "Tabs" or "Buttons", then set it back to "None" when
you are done.

Alan

Peter Doering <no****@doering .org> wrote in message news:<bp******* ******@ID-204768.news.uni-berlin.de>...
On 13 Nov 2003 13:16:39 GMT, Lyle Fairfield wrote:
ca************* **@btinternet.c om (Caroline Bradford) wrote in
news:eb******** *************** ***@posting.goo gle.com:
Oh well, back to the drawing board!


In your original post you say:

************
I planned to have two subforms, identical in design but with slightly
different data, dependent on a criterion in the main form
************

If this is the case then it's quite likely that you do not need two subforms.
One subform whose recordsource is changed on changing the citerion in the
main form should be sufficient.


And, if not RecordSource, at least having /one/ subform control and
replacing the SourceObject should help.

Peter

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
24875
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that contains the subform is named Clients. I have this code in the Add Client btn: If Forms!Clients.subformVisits!VisitDirty = True Then MsgBox "Visit subform is dirty!"
25
10266
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
1
8521
by: John Michael | last post by:
I have a form that has a subform that has a subform. The subform loads a record based on a combo lookup box in the main form. I'm trying to set a value in the subform based on a value in a subform of the subform. the main Form is called Subform is called Subform in the subform is called
4
7018
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
6
5978
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few forms in the database that will use this function, so I need to be able to tell the code which form to unlock. What I have is as follows: Public Function akeyEdit()
2
1421
RobH
by: RobH | last post by:
I have a frm_PrintQuote that launches rpt_Quotation rpt_Quotation includes a subform frm_QuoteParts frm_QuoteParts has a field SubPrice On the frm_PrintQuote I have a check box that indicates the .Visible for SubPrice fields - I have in the OnOpen for the frm_QuoteParts a SubPrice.visible = !! This works when I open just the frm_QuoteParts but it does not work when I open frm_Quotation
6
1785
by: 3338761 | last post by:
I'm a beginner programmer so bear with me if this seems very simple... I have a subform which I don't want to have displayed until the user has entered first name, last name, extension, and chose a dept. from a combobox. The If condition I tried for the first name was: If Me.Employee_First_Name.Value = Null Then Me.Report_Sub.Visible = False Else Me.Report_Sub.Visible = True
4
1975
by: PotatoChip | last post by:
I have a form which tracks Change Requests. Sometimes documentation needs to be updated as a result of the change. So, instead of bogging down the form with mulitple comment fields, I have created a subform to input any affected documents. Is there a way to hide the subform (as the form is already quite messy and large) if no documents are affected? I was thinking if the user ticks a checkbox indicating documents are affected, the subform would...
162
10298
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
0
9470
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
10298
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
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10069
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,...
0
8957
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7475
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
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
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
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.