If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Changing checkbox state with VBA

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Feb 2004
Location: Charlotte, NC
Posts: 79
Question Changing checkbox state with VBA


I am looking for a way to change the state of a checkbox from true to false or vice versa without triggering the click event for the checkbox. Does anyone know of a way to do this?

I am using Excel 2000.


Make something idiot proof and someone will make a better idiot...
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Unless you want to use API calls to intercept the event and stop it here is a simple way.

1) Put an If condition in your Click Event of checkbox with a condition.


If CheckBox.Enabled Then
Do the event code
End If

In the click event of the checkbox add a code to change the criteria:


CheckBox.Enabled = False
CheckBox.Value = True 'Event is triggered here
CheckBox.Enabled = True

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On