473,395 Members | 1,679 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,395 software developers and data experts.

Set the controls to invisible

kev
Hi folks,

Hope you guys can help.
I have a form"frmSafetyLevel1" in which users will enter data and once
they submit, the results will be displayed on "frmSL1Registration". My
problem here is i need to set some controls in the "frmSL1Registration"
to invisible if the control does not have a value "Passed, Not
Applicable, Yes or No".

The reason why i have controls without values is beacuse of this
sceanario below:
3. During all operations, troubleshooting and PMs, are all hazardous
energies locked-out, blocked, or isolated, whenever an employee has an
arm, hand, or other body part inside a "Danger Zone"?

The answer to this question will be a Yes or No. If they select Yes,
then question 4 will not need to be answered. Only if the answer is No,
they will proceed to Question 4
4. If the answer above is NO, has a normal production operations (NPO)
been submitted and approved by the NPO board.

So now i hope you got the idea right. How do i set the control for
Question(4) to be invisible in "frmSL1Registration" if it is not
answered.

Many thanks in advance folks:)
Hoping for a quick reply.

Dec 14 '06 #1
7 1940
Best thing to do is probably set its Visible property to 'No' in the
form's design view and only make it visible when they've answered
something other than what you're looking for in your third question.
Use the third question's TextBox or ComboBox AfterUpdate event to set
the value depending on the question. You likely don't want the 4th
question visible from the beginning to keep folks from going out of
order through your form. You'll have to set something up in the
AfterUpdate event to discard values in the 4th question's TextBox or
ComboBox if the answer gets changed after a prior positive result.

Something like this should work:

Private Sub Question3Combo_AfterUpdate()
Me.Question4TextBox.Visible = (Me.Question3Combo.Value <"Yes")
End Sub

Dec 14 '06 #2
kev
Hi Jamey,

It worked out perfectly fine..thanks a lot!
Just wondering if you will be able to assist me with another request
not so important but just wanted to know if it can be done.
How can we eliminate the empty space left by the invisible control?
What i mean here is when question 3 is No, the preceeding space for
question 4 automatically is empty then it goes to question 5.
i mean the design doesnt look so nice if we were to print the page with
empty spaces here and there.

Is there anything that can be done?
Thanks a million.

Jamey Shuemaker wrote:
Best thing to do is probably set its Visible property to 'No' in the
form's design view and only make it visible when they've answered
something other than what you're looking for in your third question.
Use the third question's TextBox or ComboBox AfterUpdate event to set
the value depending on the question. You likely don't want the 4th
question visible from the beginning to keep folks from going out of
order through your form. You'll have to set something up in the
AfterUpdate event to discard values in the 4th question's TextBox or
ComboBox if the answer gets changed after a prior positive result.

Something like this should work:

Private Sub Question3Combo_AfterUpdate()
Me.Question4TextBox.Visible = (Me.Question3Combo.Value <"Yes")
End Sub
Dec 14 '06 #3
On 14 Dec 2006 00:38:34 -0800, "kev" <ke******@gmail.comwrote:

On reports this is easy, see the CanShrink property.
On forms it isn't. You could adjust the Top property of other
controls. Not everyone would find that worth the trouble.

-Tom.

>Hi Jamey,

It worked out perfectly fine..thanks a lot!
Just wondering if you will be able to assist me with another request
not so important but just wanted to know if it can be done.
How can we eliminate the empty space left by the invisible control?
What i mean here is when question 3 is No, the preceeding space for
question 4 automatically is empty then it goes to question 5.
i mean the design doesnt look so nice if we were to print the page with
empty spaces here and there.

Is there anything that can be done?
Thanks a million.

Jamey Shuemaker wrote:
>Best thing to do is probably set its Visible property to 'No' in the
form's design view and only make it visible when they've answered
something other than what you're looking for in your third question.
Use the third question's TextBox or ComboBox AfterUpdate event to set
the value depending on the question. You likely don't want the 4th
question visible from the beginning to keep folks from going out of
order through your form. You'll have to set something up in the
AfterUpdate event to discard values in the 4th question's TextBox or
ComboBox if the answer gets changed after a prior positive result.

Something like this should work:

Private Sub Question3Combo_AfterUpdate()
Me.Question4TextBox.Visible = (Me.Question3Combo.Value <"Yes")
End Sub
Dec 14 '06 #4
kev <ke******@gmail.comwrote:
: Hi Jamey,

: It worked out perfectly fine..thanks a lot!
: Just wondering if you will be able to assist me with another request
: not so important but just wanted to know if it can be done.
: How can we eliminate the empty space left by the invisible control?
: What i mean here is when question 3 is No, the preceeding space for
: question 4 automatically is empty then it goes to question 5.
: i mean the design doesnt look so nice if we were to print the page with
: empty spaces here and there.

: Is there anything that can be done?
: Thanks a million.

You could disable question 4 instead of making it invisible.
Enable it only when necessary, in the same way as you've
handled the visible/invisible transition. This also gives the
user an idea of the impact of the answer to question 3
--thelma
Dec 14 '06 #5
Thelma Roslyn Lubkin wrote:
You could disable question 4 instead of making it invisible.
Enable it only when necessary, in the same way as you've
handled the visible/invisible transition. This also gives the
user an idea of the impact of the answer to question 3
This is the sensible way of doing it. You could also play with the top
property and renumbering of visible controls, but this is really
difficult to coordinate and can cause a lot of heart ache to the
developer...

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Dec 14 '06 #6
Tim Marshall wrote:
This is the sensible way of doing it. You could also play with the top
property and renumbering of visible controls, but this is really
difficult to coordinate and can cause a lot of heart ache to the
developer...
Oops, I didn't see Tom's response already there...

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Dec 14 '06 #7
kev
Hi Tom,

Could you please elaborate more on this for both reports and forms?
Thanks:)

Tom van Stiphout wrote:
On 14 Dec 2006 00:38:34 -0800, "kev" <ke******@gmail.comwrote:

On reports this is easy, see the CanShrink property.
On forms it isn't. You could adjust the Top property of other
controls. Not everyone would find that worth the trouble.

-Tom.

Hi Jamey,

It worked out perfectly fine..thanks a lot!
Just wondering if you will be able to assist me with another request
not so important but just wanted to know if it can be done.
How can we eliminate the empty space left by the invisible control?
What i mean here is when question 3 is No, the preceeding space for
question 4 automatically is empty then it goes to question 5.
i mean the design doesnt look so nice if we were to print the page with
empty spaces here and there.

Is there anything that can be done?
Thanks a million.

Jamey Shuemaker wrote:
Best thing to do is probably set its Visible property to 'No' in the
form's design view and only make it visible when they've answered
something other than what you're looking for in your third question.
Use the third question's TextBox or ComboBox AfterUpdate event to set
the value depending on the question. You likely don't want the 4th
question visible from the beginning to keep folks from going out of
order through your form. You'll have to set something up in the
AfterUpdate event to discard values in the 4th question's TextBox or
ComboBox if the answer gets changed after a prior positive result.

Something like this should work:

Private Sub Question3Combo_AfterUpdate()
Me.Question4TextBox.Visible = (Me.Question3Combo.Value <"Yes")
End Sub
Dec 15 '06 #8

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

Similar topics

0
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and...
7
by: Martin | last post by:
Hi, I have a page where according to the mode of use, different controls are visible. I had assumed that Page.DataBind() would only bind visible controls, but apparently not. Do I have to...
6
by: dhnriverside | last post by:
Hi peeps, I'm trying to create some controls textboxes at runtime, based on the number of items in a IETreeView that are checked. That I can do, I've got a place holder and I can create the...
11
by: Frank Esser | last post by:
Hi, I created an ASP.NET page (test.aspx) with some web controls in GridLayout (Design time). When I look at the collection page.controls by foreach (Control ctrl in Page.Controls) { ....
0
by: aeshtry | last post by:
Hello dear friends I have an urgent question. Would you please give me your professional idea? I have an html table containing the ASP.Net validation summary and an ASP.Net label control. The...
1
by: kev | last post by:
Hi folks, Hope you guys can help. I have a form"frmSafetyLevel1" in which users will enter data and once they submit, the results will be displayed on "frmSL1Registration". My problem here is i...
2
by: PGP | last post by:
I have a windows form where i bind data to an invisible text box and it doesnt seem to work. I tried with an invalid datamember name and it doesnt even generate an exception till i make the control...
2
by: snow | last post by:
Hi All, I am using VS 2005. I put some controls within a control panel and the control panel is in a tab control page. For some reason, the controls are invisible at design time. when I run the...
0
by: Riverburn | last post by:
C# - using forms using Visual studio 2005 WinXP SP 2 The Title is a bit strange, but I had no idea what else to call my problem. it is a rather specific problem, and I don't know if there is a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.