|
-
Oct 30th, 2000, 03:41 PM
#1
You ever have one of those days when you just wish that someone were to accidentaly (and repeatedly) smash your workstation with a sledgehammer?
I am trying to programmaticaly set the value of a checkbox programmaticaly.... and I keep getting an error (invalid protperty value). Thinking that it might be something incredibly odd with my project, I open up a brand spankin new window (with one checkbox named 'Check1').
I then add a command button.. to the button's click event, I add the code "Check1.Value = True". Now this SHOULD work, as when I enter break mode it is responding to a ? Check1.Value .... but when I execute it it gives me the same bloody error (Invalid Property Value... or something to that extent).
What I need to know is a) should this work (I know the answer but it does not hurt to be certain)
b) have any of you EVER seen this happen? If so, how did you resolve it?
-
Oct 30th, 2000, 03:46 PM
#2
Hyperactive Member
Wrong Type
The CheckBox.value Doesn't use boolean it uses integer like this
Code:
Check1.Value=1 'To Checkit
Check1.Value=0 'To Uncheckit
Saludos...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Oct 30th, 2000, 04:01 PM
#3
...
Ok, now I am just baffled. What you say works, but this particular code was WORKING a little while ago. I'm working on a form that had been designed by someone else, but that needed reworking. The code to handle the checkboxes was code that I did not touch and, IIRC, worked prior to the redesign (at the VERY least it gave no errors).
In any case, thanks for the info.
-
Oct 30th, 2000, 04:24 PM
#4
Lively Member
Try this approach
Code:
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Check1.Caption = "Checked" 'Or put the code that you want to execute when checked
ElseIf Check1.Value = vbUnchecked Then
Check1.Caption = "Unchecked" 'Or put the code that you want to execute when unchecked
End If
End Sub
Hope this helps
Cordially,
Flint
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|