Use check box to populate a text box

  • Thread starter Thread starter Bill Davis
  • Start date Start date
B

Bill Davis

I have a check box on my form and when it is check i want
to display "Pending" in the text box below it and display
it in red. Is this possible?
Thanks in advance
 
Bill

In the AfterUpdate event of the checkbox, add code that sets the text and
color of your text message.

It would look something like (actual syntax may vary):

If Me!chkMyCheckBox = True Then
Me!txtMyTextMessage = "Pending"
Me!txtMyTextMessage.ForeColor = vbRed
ElseIf Me!chkMyCheckBox = False Then
Me!txtMyTextMessage = ""
Else
'handle this error
End If

Good luck!

Jeff Boyce
<Access MVP>
 
Jeff,
When a box is check it displays Pending for all the
records and when i remove the check it removed it from
all records. Any ideal of what I am doing wrong?
Bill
 
The checkbox control source should be a part of your underlying table.

Damon
 
Bill

Are you working with a datasheet view? Is (as Damon asks) the checkbox
unbound or bound?
 
It is a bound to the main table, that is why i dont
understand why it is not working..
 
Lou

Please re-read my previous post -- are you using a single-form or datasheet
view?
 

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

Back
Top