Automatically Check Checkbox

C

CMD

I'm building a database in which I would like to have checkboxes
automatically checked on a summary form once certain other information has
been entered into the underlying table.
Is there any way to do this???
 
R

Randy

Dear CMD,

Try the following:

'Please place this code on the AfterUpdate events of both: Field1 and
Field2.
IF ((NZ(Me.Field1,"") <> "") AND (NZ(Me.Field2,"") <> "")) THEN
'Check the checkbox if both Field1 and Field2 are populated
Me.Check1 = True
ELSE
'Uncheck the checkbox if Field1 and Field2 are empty
Me.Check1 = False
END IF

-Randy
 
C

CMD

Hi Randy,

Thanks for your response. The code you sent appears to be exactly what I
need, but it doesn't seem to be working. When I substitute the field names,
this is what it looks like:

If ((Nz(Me.[LRP Held], "") <> "") And (Nz(Me.[Date Received], "") <> "")) Then
'Check the checkbox if both LRP Held and Date Received are populated
Me.LRP Responded = True
Else
'Uncheck the checkbox if LRP Held and Date Received are empty
Me.LRP Responded = False
End If

(LRP Held is the field I would like to trigger the code, and LRP Responded
if the box I want checked if that field is populated.)

Can you tell me where I might be going wrong?
Thanks for your help!
CMD
 
R

Randy

Replies inline,

Thanks for your response. The code you sent appears to be exactly what I
need, but it doesn't seem to be working. When I substitute the field
names,
this is what it looks like:

If ((Nz(Me.[LRP Held], "") <> "") And (Nz(Me.[Date Received], "") <> ""))
Then
'Check the checkbox if both LRP Held and Date Received are populated
Me.LRP Responded = True
Else
'Uncheck the checkbox if LRP Held and Date Received are empty
Me.LRP Responded = False
End If

The error is your checkbox code for "LRP Responded ". Fix it as follow:
Me.[LRP Responded] = True
 
C

CMD

Randy,
I've been out sick and just got your reply, but you are AWESOME!!! Thank you
so much. It works like a charm!!!! I'm just thrilled.

Anybody else reading this, Randy is THE MAN!! :) Have a great week!
CMD


Randy said:
Replies inline,

Thanks for your response. The code you sent appears to be exactly what I
need, but it doesn't seem to be working. When I substitute the field
names,
this is what it looks like:

If ((Nz(Me.[LRP Held], "") <> "") And (Nz(Me.[Date Received], "") <> ""))
Then
'Check the checkbox if both LRP Held and Date Received are populated
Me.LRP Responded = True
Else
'Uncheck the checkbox if LRP Held and Date Received are empty
Me.LRP Responded = False
End If

The error is your checkbox code for "LRP Responded ". Fix it as follow:
Me.[LRP Responded] = True
 
R

Randy

CMD said:
Randy,
I've been out sick and just got your reply, but you are AWESOME!!! Thank
you
so much. It works like a charm!!!! I'm just thrilled.

Anybody else reading this, Randy is THE MAN!! :) Have a great week!
CMD

Thanks for all the kind words ;-)
Glad everything is working.

-Randy
 

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