Check Box

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
 
D

Douglas J. Steele

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)
 
G

Guest

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


.
 
D

Douglas J. Steele

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


.
 
H

Howard

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





.


.
 

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