Check Boxes

G

Guest

I am trying to set up a Form with two check boxes that when both are set will
put a certain value in a number field in the table. Any other condition will
have a second value placed in the field. I've had limited suggess in getting
this to work. I need to have the value saved for each record in order to use
that value later on to determine the status of the record.

(i.e. Check1 and Check2 are set. The number -1 would then be set in the
[StatusCode] field. If any other combination of the two is set then the
number 0 would then be placed in [StatusCode])

What I want is to determine if a certain Electronic system is up or down
depending on the criteria selected by the Check Boxes. Any ideas?
 
G

Guest

Hi, Jeff.

Are these checkboxes bound to fields in your table? If so, you needn't and
shouldn't try to store a value in another field; simply calculate the field
in a query:

= IIf (([Check1]= True AND [Check2] = True),-1, 0)

If these are unbound checkboxes, set your Status field in the AfterUpdate
event of each checkbox:

If ([Check1] = True AND [Check2] = True) Then
[Status] = -1
Else
[Status] = 0
End If

Hope that helps.
Sprinks
 
G

Guest

Thanks Sprinks. That helped me figure out what I needed to do.

Jeff

Sprinks said:
Hi, Jeff.

Are these checkboxes bound to fields in your table? If so, you needn't and
shouldn't try to store a value in another field; simply calculate the field
in a query:

= IIf (([Check1]= True AND [Check2] = True),-1, 0)

If these are unbound checkboxes, set your Status field in the AfterUpdate
event of each checkbox:

If ([Check1] = True AND [Check2] = True) Then
[Status] = -1
Else
[Status] = 0
End If

Hope that helps.
Sprinks

Jeff said:
I am trying to set up a Form with two check boxes that when both are set will
put a certain value in a number field in the table. Any other condition will
have a second value placed in the field. I've had limited suggess in getting
this to work. I need to have the value saved for each record in order to use
that value later on to determine the status of the record.

(i.e. Check1 and Check2 are set. The number -1 would then be set in the
[StatusCode] field. If any other combination of the two is set then the
number 0 would then be placed in [StatusCode])

What I want is to determine if a certain Electronic system is up or down
depending on the criteria selected by the Check Boxes. Any ideas?
 

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

Top