check box to update field in table with 4 or 0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On my form I need a check box. I would like the check box update the table
field "Issue1" with a value of 4 if it is checked and a value of 0 if it is
not checked.

Is this possible and if so what is the code. How can I make this update my
table with the correct number 4 or 0?

Thanks in advance,
 
Access Yes/No fields (?is this what you mean by checkbox field) have values
of 0 (False/No) and -1 (True/Yes).

If you'll explain more about what "4" represents, and what business need you
are attempting to solve by storing a "4", the newsgroup readers may be able
to offer more specific suggestions.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Yes I mean the Yes/No...

Is there a way to say ...
If yes then field = 4 else field = 0

I have a series of check boxes with questions.
When the question is checked the field gets a ranking number(4) if it is not
checked the ranking is 0. I need to be able to use the total rankings of all
quetsions in a calculation later.
 
In the On Current event of your form put;

If Me.NameOfYourCheckbox = True Then

Me.NameOfYourOtherField = 4

Else

Me.NameOfYourOtherField = 0

End If

HTH
 
So, another approach might be to store the True or False, then "do the math"
in a subsequent query. There may not be a need to actually store the 4...

And by doing the math in a query, you have the option of changing the
weighting in the future without having to modify the stored values in your
table ... just modify the factor in your calculating query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top