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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Box - Formatting action 2

Status
Not open for further replies.

filthepitome

Technical User
Aug 29, 2006
26
US
First I would like to say I know zero VB, I could work my way through editing some of it, but could not write it myself.

That being said does anyone know of an "easy" way to keep say 3 fields hidden. If a check box is clicked (Value to Yes) the three hidden fields will become visible and data can be entered into them.

Sorry for the generic dumb question, but if anyone can be of any help it would be greatly appreciated

TIA
 
how are ya filthepitome . . .

In the [blue]AfterUpdate[/blue] event of the checkbox try this:
Code:
[blue]   Dim flg As Boolean
   
   If Me!CheckboxName Then
      flg = True
   Else
      flg = False
   End If
   
   Me![purple][b][i]textbox1Name[/i][/b][/purple].Visible = flg
   Me![purple][b][i]textbox2ame[/i][/b][/purple].Visible = flg
   Me![purple][b][i]textbox3ame[/i][/b][/purple].Visible = flg[/blue]

Calvin.gif
See Ya! . . . . . .
 
Sorry about the mess . . .

Should be:
Code:
[blue]   Dim flg As Boolean
   
   If Me![purple][b][i]CheckboxName[/i][/b][/purple] Then
      flg = True
   Else
      flg = False
   End If
   
   Me![purple][b][i]Textbox1Name[/i][/b][/purple].Visible = flg
   Me![purple][b][i]Textbox2Name[/i][/b][/purple].Visible = flg
   Me![purple][b][i]Textbox3Name[/i][/b][/purple].Visible = flg[/blue]

Calvin.gif
See Ya! . . . . . .
 
AWESOME !!!!!!!!!!!!! Works flawlessly, thank you very very much :)
 
filthepitome . . .

[/blue]Great![/blue]

BTW: [blue]Welcome to Tek-Tips![/blue] To get great answers be sure to have a look at FAQ219-2884 or FAQ181-2886

Calvin.gif
See Ya! . . . . . .
 
Hi filthepitome,
If someone successfully answered your question, please give him/her a star, not only to credit the person, but so other people can see that the issue is dealt with.

Pampers [afro]
Keeping it simple can be complicated
 
Howdy pampers . . .

Appreciate the post and intent [thumbsup2] . . . but prompting for stars is inapproriate in the forums [thumbsdown] . . . however leaving the faq's is [thumbsup2]

Calvin.gif
See Ya! . . . . . .
 
Hi TheAceman1,
Yes I know... Couldn't resist. ;-)


Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top