Automatically Set Checkbox value based on a combo box value 
Author Message
 Automatically Set Checkbox value based on a combo box value

Hi,

I was wondering if anyone knows how I can go about getting
a checkbox in a form to automatically set to either -1 or
0 based on a value that I choose in a combo box on the
same form.  In other words I would like to set the
checkbox value to -1 if I choose one of the values in my
combo box but set it to 0 if I choose any of the other
values in the combo box.  The Row source for the combo box
does not lookup to a table but is a list I typed into the
combo box properties under row source.  I am able to set
the default value for the checkbox to -1 but cannot figure
out how to build the logic for it to look at the combo box
value to determine whether the checkbox value should be -1
or 0 based on the selection I chose from the combo box.

Any help would be appreciated.
Thx.



Sat, 18 Mar 2006 08:55:41 GMT  
 Automatically Set Checkbox value based on a combo box value
Chris,

Use the Select Case statement. e.g.

    Select Case Me.MyComboName
    Case "Peter", "Paul", "Mary"
        Me.MyCheckBoxName = True
    Case Else
        Me.MyCheckBoxName = False
    End Select

HTH,

Neil.


Quote:
> Hi,

> I was wondering if anyone knows how I can go about getting
> a checkbox in a form to automatically set to either -1 or
> 0 based on a value that I choose in a combo box on the
> same form.  In other words I would like to set the
> checkbox value to -1 if I choose one of the values in my
> combo box but set it to 0 if I choose any of the other
> values in the combo box.  The Row source for the combo box
> does not lookup to a table but is a list I typed into the
> combo box properties under row source.  I am able to set
> the default value for the checkbox to -1 but cannot figure
> out how to build the logic for it to look at the combo box
> value to determine whether the checkbox value should be -1
> or 0 based on the selection I chose from the combo box.

> Any help would be appreciated.
> Thx.



Sat, 18 Mar 2006 17:00:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to set value in text box based on value in combo box

2. setting a list box value based on the value selected in a combo box

3. Combo box that displays value based on the value selected in other combo box

4. Set value in second combo box based on first combo box

5. Can't get combo box values based on text box values to work

6. Display text box value based on combo box value

7. ? Automatically setting a value based on value in another field

8. Combo box value based on another combo box

9. Filling combo box based on value in another combo box

10. Combo Box List based on another combo box value


 
Powered by phpBB® Forum Software © phpBB Group