VBA MS Access: Runtime error "Object variable not declared or with block variable not set" when using a check box
Posted on 2004-11-05
I have a dao record set, recrd, with a field ALS which is a True/False variable. A form has a checkbox with the record source as recrd("ALS"). using the following If statement:
If recrd("ALS").Value = True Then
When the checkbox on the form is checked, the If statement executes properly. If the checkbox is not checked I get the error "Object variable not declared or with block variable not set." It seems the If statement works as it should when the value is true, but not if it is false. I have debugged using Debug.Print recrd("ALS") and the values return as they should, true when the checkbox is checked and false when the checkbox is false.