settign unbound checkboxes based on text field entry

G

Guest

On my report, I have 4 unbound checkboxes. But I would like to have them
either be checked (true) or unchecked (false) based on data entered in
specific text fields.

What I mean is checkbox #1 is either checked or unchecked based on a text
field which is titled LOCATION. In LOCATION, there are two list items to
chose from; "In" and "Out". If the data is set to "Out", I want this checkbox
checked. If its set to "In", I want the checkbox blank, or false

On checkbox #2, I an checking a date field titled DATE_LOANED. If the field
has a date in it, I want the checkbox to be checked. If there is no date, I
want the checkbox unchecked.

Checkbox #3 is like #2, only I am looking at a regular text field
CLAIM_NUMBER instead of a date field.

Checkbox #4 is looking at a FIRST_NAME field. If the field has the word
"OTC", then I want the checkbox checked. Otherwise, anything else would have
the checkbox unchecled.

I tried this line of code for the first checkbox:

If Me.Location = "Out" Then Me.CheckboxName = True
But all this did was make the checkbox checked, regardless if the field was
set to "In" or "Out".

I've asked questions in the past and find that everyone here has been a
tremendous amount of help. I'd appreciate a little more help again! <G>

thanks,

Richard
 
M

Marshall Barton

Richard said:
On my report, I have 4 unbound checkboxes. But I would like to have them
either be checked (true) or unchecked (false) based on data entered in
specific text fields.

What I mean is checkbox #1 is either checked or unchecked based on a text
field which is titled LOCATION. In LOCATION, there are two list items to
chose from; "In" and "Out". If the data is set to "Out", I want this checkbox
checked. If its set to "In", I want the checkbox blank, or false

On checkbox #2, I an checking a date field titled DATE_LOANED. If the field
has a date in it, I want the checkbox to be checked. If there is no date, I
want the checkbox unchecked.

Checkbox #3 is like #2, only I am looking at a regular text field
CLAIM_NUMBER instead of a date field.

Checkbox #4 is looking at a FIRST_NAME field. If the field has the word
"OTC", then I want the checkbox checked. Otherwise, anything else would have
the checkbox unchecled.

I tried this line of code for the first checkbox:

If Me.Location = "Out" Then Me.CheckboxName = True
But all this did was make the checkbox checked, regardless if the field was
set to "In" or "Out".


No code needed for this. Set each of the check box's
ControlSource expression to this kind of thing:

=Location = "OUT"
=Not DATE_LOANED Is Null
 
G

Guest

Marsh,

thanks again. I'm starting to get scared, because I think I am actually
catching on lol

Richard
 

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