Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidding a field 2

Status
Not open for further replies.

InsaneProgrammer

Programmer
Jan 17, 2001
44
US
I have a form that requires the user to check several boxes. After the user checks one of the boxes I want a text field to become visible so the user can enter additional info. On the field I have set the visible property to false but am having difficulty using code to change the property to true when the box is checked. Any ideas?
 
Have you tried putting the test for IsChecked in the AfterUpdate of the checkbox? If so, can we see the code? Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Hi InsaneProgrammer and yes we probably all are!
Try this in the after update event of your check box:

If Me![NameOfCheckBox] = -1 Then
Me![NameOfField].Visible = True
Else
Me![NameOfField].visible = False
End if

You should also set the default value for any checkbox to True (-1) or False (0) to avoid those nasty grey boxes...
Gord
ghubbell@total.net
 
The problem I'm having isn't with determining if the check box has been checked. I'm using
Not IsNull(FieldName)to determine if the box has been checked. I just don't know the syntax to change visible = true on the field. I hope this explains a little better.
 
The idea I gave and Gord's coded response should be the way this is done. I believe a checkbox has three possible values (1,0,-1), not a null value... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Put this in the Checkbox's AfterUpdate event:

txtTest.Visible = chkTest

This will make txtText visivle if chkTest is checked and invisible if it is not.

Good Luck...
Shane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top