By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,622 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Set the controls to invisible

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.