Setting True/False on a CheckBox

alktrigger

Aimless Extraordinaire
Local time
Today, 16:32
Joined
Jun 9, 2009
Messages
124
I am trying to set the value of a Checkbox inside a If/Then function in the Form_Load() function, but I keep getting a run time error.

What is the single line of code that will set my check box to true/false?
I expect something along the lines of chkSent.value = True but it offers me Run Time Error 2448 "cannot assign value to this object"

I know this is simple, but it has escaped me. Suggestions would be much appreciated!
 
remove .Value, i think.
 
Its giving me a whole different RTE '-2147352527 (80020009)'
 
yeah, that was kind of a silly idea.
could it be the if/then part?
maybe set up some error handling on the form's error event and see what msg you get.
 
Fixed by copying a working checkbox from another form
 
i was about to say it sounded messed up and try replacing it...
 
How about [chkSent] = TRUE ( or FALSE)

What you wrote using chkSent (without the brackets) looks like setting a variable name. If you don't have Option Explicit then you not only set the value but actually CREATED the variable in which you set that value.
 
I tend to use Me.chkCheckBox = True

with the Me. to explicitly say I am looking for a control on my form.
 

Users who are viewing this thread

Back
Top Bottom