VBA Check and Option Check Boxes 
Author Message
 VBA Check and Option Check Boxes

I have encountered a problem with VB in Access 2.0.  I am writing an app
to scan a set of forms and return selected property values from each
form.  The problem is that Check Boxes and Option Group Check Boxes both
register as type "CheckBox" when using "If Typeof <object> Is CheckBox
Then".  I get a true return for option check boxes, then try to retrieve
the ControlSource property and get an untrappable error.  (Invalid
reference to property 'ControlSource'.)  I need a way to differentiate
between the two types of Check Boxes from code.
Any assistance will be greatly appreciated.




Tue, 29 Jun 1999 03:00:00 GMT  
 VBA Check and Option Check Boxes

Quote:
> I get a true return for option check boxes, then try to retrieve
>the ControlSource property and get an untrappable error.  (Invalid
>reference to property 'ControlSource'.)

It's error 2455, and very trappable. Just use error handling to trap
the error and do the Option Group Check Box stuff.

    ...Joe Maki



Wed, 30 Jun 1999 03:00:00 GMT  
 VBA Check and Option Check Boxes

Hi David,

Quote:
> form.  The problem is that Check Boxes and Option Group Check Boxes both
> register as type "CheckBox" when using "If Typeof <object> Is CheckBox
> Then".

This is a side issue to your point, but it is considered bad UI design to
use check boxes for mutually exclusive options (i.e. in an option groups.)
Check boxes should be uses when you can select more than one option; option
buttons (radio style buttons) should be used in option groups when the
choices are mutually exclusive.

MS should never have even given the option  of using check boxes in an
option group, IMO. Their reasoning was that this could be used to simulate
paper forms where a check box would look better than an option button...

--
-- Jim F, FMS
   http://www.fmsinc.com



Wed, 30 Jun 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VBA controls (Text boxes, check boxes, etc)

2. create form in word: include option buttons and check boxes

3. Check Box and Option button

4. VB4 Option/Check Boxes - HELP

5. listbox with check box option selected

6. Check Boxes, Option Buttons

7. HOW TO?? - list of options with check-boxes

8. TreeView - Check Boxes/Options?

9. Check Boxes with options

10. Placing a check in check mark boxes and have it add prices

11. checked listview, background color, and the stupid check boxes

12. Check for checked values in List Box

 

 
Powered by phpBB® Forum Software