Check Box Update

C

Craig Cannon

I want to use a check box to indicate when a value in a text box on the form
matches a value in a table. I beleive I can use DLOOKUP to match the values,
but not sure of the syntax or where to put it. I'm am pretty sure it does not
go on Form Load.

Any help is appreciated.
 
R

Rick Brandt

Craig Cannon said:
I want to use a check box to indicate when a value in a text box on the form
matches a value in a table. I beleive I can use DLOOKUP to match the values,
but not sure of the syntax or where to put it. I'm am pretty sure it does not
go on Form Load.

Any help is appreciated.

If this is a single view form then the Current event would be the place to do
it. If a continuous view then you would need to use an Expression in a
ControlSource of a TextBox rather than code. In both cases DLookup() could do
the job, but a subquery might be a better choice for the continuous form for
performance reasons.
 
C

Craig Cannon

Aaahhhh. (required forehead slap) That makes sense. A calculated field in the
query in which the form is based. This will return 1 or 0 or True or False.

Here's what I did, though.

I added the table to my query so that I could see if there actually were any
items that matched. I added the Symbol column from that table to my query and
setup the join. Since there were I added a text box assigned it to that field
and made it invisible.

I then used the following as the Control Source for the check box.

=IIf(IsNull([SYMBOL]), False, TRUE)

This works like a charm. Comments?
 
Top