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

Hide Controls

P: n/a
jpr
Hello friends,

I have a form named forms1 on which I have a txtbox which gets its data
from a query. This field shows values YES or NO.

On the same form I have two unbound check boxes.What I am looking for
is a code that if txtbox shows YES then checkbox1 is checked and
checkbox2 not visible.
If txtbox shows value NO, then checkbox1 is not visible and checkbox2
should be checked.

Is there a way I can do this? Thanks.

Feb 24 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"jpr" <jp***@tin.it> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hello friends,

I have a form named forms1 on which I have a txtbox which gets its data
from a query. This field shows values YES or NO.

On the same form I have two unbound check boxes.What I am looking for
is a code that if txtbox shows YES then checkbox1 is checked and
checkbox2 not visible.
If txtbox shows value NO, then checkbox1 is not visible and checkbox2
should be checked.

Is there a way I can do this? Thanks.


Why you'd want to do this is a bit of a mystery to me but ... in the form's
current event (untested):

If Me.txtMyTextBox = "Yes" Then
Me.chkCheck1 = -1
Me.chkCheck2.Visible = False
Else
Me.chkCheck2 = -1
Me.chkCheck1.Visible = False
End If

Of course you'd have to code for when a value is changed from Yes to No and
vice-versa and also to handle nulls. There may be other conditions to
handle too that I can't think of off the top of my head.

HTH - Keith.
www.keithwilby.com
Feb 24 '06 #2

P: n/a
On 24 Feb 2006 00:50:25 -0800, jpr wrote:
Hello friends,

I have a form named forms1 on which I have a txtbox which gets its data
from a query. This field shows values YES or NO.

On the same form I have two unbound check boxes.What I am looking for
is a code that if txtbox shows YES then checkbox1 is checked and
checkbox2 not visible.
If txtbox shows value NO, then checkbox1 is not visible and checkbox2
should be checked.

Is there a way I can do this? Thanks.


Re: > This field shows values YES or NO.<
As a Text value?

Code the Form's Current event as well as the txtbox AfterUpdate event:
[Check1].Visible = [txtbox] = "Yes"
[Check2].Visible = Not [txtbox] = "Yes"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Feb 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.