chewy Posted October 10, 2003 Posted October 10, 2003 I can't get my check boxes to work. So far I have on check box called box1 and one button called total. code is as follows: Dim box1 as Boolean If box1 = true then messagebox.show("hello I am true") else if box1 = false then messagebox.show("hello I am false") End if I don't know why this doesn't work. The message box always comes up as hello I am false it doesn't matter if the box is checked or not. Why is this, and how do I correct it. Quote
*Experts* mutant Posted October 10, 2003 *Experts* Posted October 10, 2003 You simply create a boolean value and do not do anything to it. And by default booleans are false. If you want to see whether a checkbox is checked you can do it like this: If checkbox1.Checked Then 'it is checked Else 'its not checked End If Quote
chewy Posted October 10, 2003 Author Posted October 10, 2003 so it would look like this: dim checkbox1 as boolean If checkbox1.checked then messagebox.show("hi I am true") else if checkbox1.unchecked then messagebox.show("hi i am false") End if Quote
*Experts* mutant Posted October 10, 2003 *Experts* Posted October 10, 2003 No. Change the name "checkbox1" to the name of your checkbox. Simply calling a boolean variable like your check wont work, because there is no relation between them and there would a variable name conflict :). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.