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 November 24th, 2006, 08:45 AM
Authorized User
 
Join Date: Oct 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check Box Event

Hi Frnds,

              I want to perform such an operation where after selecting the check box one message box will appear and after deselecting the check box another message box will appear. Please tell me how to do this(with sample code) as I am in new in MS ACCESS programming.



 
Old November 27th, 2006, 07:47 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Prasanta,

Use the AfterUpdate event and then evaluate the checkbox.

1. So, make a form and place a check box on the form.
2. Call the checkbox chk1 for the moment.
3. Now bring up the properties for the checkbox and select the Event tab.
4. Find the AfterUpdate event and click the elipsis (...) button at the end of the row, select "Code Builder" when prompted.
5. You should now be in code, with a sub routine called "chk1_AfterUpdate".
6. Now you need to evaluate chk1... given that it is a checkbox, it will be true or false... so, code:

Private sub chk1_AfterUpdate()
if me.chk1 then
'whatever actions you want to do when it is checked
else
'whatever actions you want to do when it is not checked
end if
end sub

Should give you enough to get going with it.

Lee





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 all checkboxes with a <td> onClick event crmpicco Javascript How-To 1 August 19th, 2005 09:17 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.