Check Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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?
 
Back
Top