Check Box

  • Thread starter Thread starter Howard
  • Start date Start date
H

Howard

I'm having trouble determining whether a check box on my
form has been checked. Actually, I would rather be able to
determine that it has NOT been checked. I have attempted
the following statements with no success. ('Zone' is part
of a 'for' loop which increments from 1 to 16)

If Forms![NewAudioSystem].Controls("AB" & Zone).Value =
False Then

If Not Forms![NewAudioSystem].Controls("AB" & Zone).Value
Then

If Not Forms![NewAudioSystem].Controls("AB" &
Zone).Checked Then
 
If Forms![NewAudioSystem].Controls("AB" & Zone).Value = False Then

should work, provided NewAudioSystem is open as a form (not a subform) and
your checkboxes are actually named AB1, AB2, etc. to AB16. (You don't really
need the .Value, but there's nothing wrong with having it)
 
It's not working. My problem must be elsewhere. I put a
breakpoint at that statement and it shows me that the
value is Null. I them tried Null instead of false. It
still didn't work. I'll keep at it. Any other suggestions
are appreciated. Thanks!
-Howard
-----Original Message-----
If Forms![NewAudioSystem].Controls("AB" & Zone).Value = False Then

should work, provided NewAudioSystem is open as a form (not a subform) and
your checkboxes are actually named AB1, AB2, etc. to AB16. (You don't really
need the .Value, but there's nothing wrong with having it)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm having trouble determining whether a check box on my
form has been checked. Actually, I would rather be able to
determine that it has NOT been checked. I have attempted
the following statements with no success. ('Zone' is part
of a 'for' loop which increments from 1 to 16)

If Forms![NewAudioSystem].Controls("AB" & Zone).Value =
False Then

If Not Forms![NewAudioSystem].Controls("AB" & Zone).Value
Then

If Not Forms![NewAudioSystem].Controls("AB" &
Zone).Checked Then


.
 
Have the checkboxes been assigned values? If not, then yes, their values
will be Null.

What do you want to do if the value is Null? Treat it as False, or as True?

If the former, try:

If Nz(Forms![NewAudioSystem].Controls("AB" & Zone).Value, False) = False
Then

If the latter, try:

If Nz(Forms![NewAudioSystem].Controls("AB" & Zone).Value, True) = False Then

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


It's not working. My problem must be elsewhere. I put a
breakpoint at that statement and it shows me that the
value is Null. I them tried Null instead of false. It
still didn't work. I'll keep at it. Any other suggestions
are appreciated. Thanks!
-Howard
-----Original Message-----
If Forms![NewAudioSystem].Controls("AB" & Zone).Value = False Then

should work, provided NewAudioSystem is open as a form (not a subform) and
your checkboxes are actually named AB1, AB2, etc. to AB16. (You don't really
need the .Value, but there's nothing wrong with having it)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm having trouble determining whether a check box on my
form has been checked. Actually, I would rather be able to
determine that it has NOT been checked. I have attempted
the following statements with no success. ('Zone' is part
of a 'for' loop which increments from 1 to 16)

If Forms![NewAudioSystem].Controls("AB" & Zone).Value =
False Then

If Not Forms![NewAudioSystem].Controls("AB" & Zone).Value
Then

If Not Forms![NewAudioSystem].Controls("AB" &
Zone).Checked Then


.
 
WhoooooHooooo ! It worked !!!!!! (you're first
suggestion) Thanks a ton! You're a godsend. Bye for now.
-Howard
-----Original Message-----
Have the checkboxes been assigned values? If not, then yes, their values
will be Null.

What do you want to do if the value is Null? Treat it as False, or as True?

If the former, try:

If Nz(Forms![NewAudioSystem].Controls("AB" & Zone).Value, False) = False
Then

If the latter, try:

If Nz(Forms![NewAudioSystem].Controls("AB" & Zone).Value, True) = False Then

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


It's not working. My problem must be elsewhere. I put a
breakpoint at that statement and it shows me that the
value is Null. I them tried Null instead of false. It
still didn't work. I'll keep at it. Any other suggestions
are appreciated. Thanks!
-Howard
-----Original Message-----
If Forms![NewAudioSystem].Controls("AB" & Zone).Value = False Then

should work, provided NewAudioSystem is open as a form (not a subform) and
your checkboxes are actually named AB1, AB2, etc. to AB16. (You don't really
need the .Value, but there's nothing wrong with having it)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm having trouble determining whether a check box on my
form has been checked. Actually, I would rather be
able
to
determine that it has NOT been checked. I have attempted
the following statements with no success. ('Zone' is part
of a 'for' loop which increments from 1 to 16)

If Forms![NewAudioSystem].Controls("AB" & Zone).Value =
False Then

If Not Forms![NewAudioSystem].Controls("AB" & Zone).Value
Then

If Not Forms![NewAudioSystem].Controls("AB" &
Zone).Checked Then





.


.
 
Back
Top