Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2006, 02:28 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA - Check box

This is probably a simple questions, but I have a check box and would like for it to either when checked make certain cells visible or not checked invisible.

does anyone have macros which run behind an active sheet to do this?

Thank you
 
Old May 19th, 2006, 02:38 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

With Checkbox as chkMyCheckbox - Goto Properties, Events and choose the On Click event. Then pick Code Editor.

Add this inside of that Sub Procedure...

If chkMyCheckbox.value = -1 then 'Checked
     lblMyLabel.visible = True
     txtMyTextbox.visible = True
Else
     lblMyLabel.visible = False
     txtMyTextbox.visible = False
End if

Hope that helps,

Mike


Mike
EchoVue.com
 
Old May 22nd, 2006, 10:43 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I find I need to add this code to the On Current event of the form as well, since I usually set the default for the controls as Visible = No.



mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
check box help? dstein4d Access VBA 2 February 27th, 2008 09:54 AM
Check BOx kaushikpulpa ASP.NET 2.0 Professional 2 August 30th, 2007 08:01 AM
Check Box Event prasanta2expert Access VBA 1 November 27th, 2006 07:47 AM
please help (get check box value) qadeerahmad General .NET 3 September 24th, 2004 08:46 AM
how to get value from check box..... cici Classic ASP Professional 2 May 15th, 2004 08:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.