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

Hide Controls

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
2 3615
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
2
by: cm | last post by:
HI, here's my problem; My application loads up 3 forms at startup. Deppending on what button is press on form1 i want to show or hide controls on form2. I cant seem to get access to the...
1
by: Jeremy S | last post by:
I want to show or hide a bunch of related controls at runtime (textboxes, labels, check boxes). Is the Panel control the only way to go? Are there alternatives? Thanks.
0
by: pargat.singh | last post by:
Hi : I am using Master/Child page in VS2005 and i wrote generic function to show/hide controls which works fine if i don't use master/child .Below is my function which work fine for single page...
4
by: Charlie Brown | last post by:
I have a form with 2 custom controls that can be dragged around by a user. How can I check if they overlap each other without performing some kind of Collision detection on them? Is there...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
2
by: =?Utf-8?B?a2V2aW4=?= | last post by:
using VS2005 My masterpage has two panels and two hyperlinks. The initial content aspx page is blank. The page_load event of the masterpage hides one of the panels based on SESSION...
1
by: Anne | last post by:
Hi, I have a gridview that display questions & answers. In some case the answers are text (up to 5000 char) and other cases they are tick boxes or numbers ($), or date. I have created 2...
0
by: xollie | last post by:
i have created the login form for different users. the user must enter the username and password if both of this are correct the Grant form will open. the grant form has the tab control with 4...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.