ChkBox Caption change when clicked

D

d9pierce

Hi all,
I have a check box on a form that when I click the checkbox, I want the
caption to change. I have this code on the click event and it works
fine with one minor detail, it changes all the records to this caption
and doesnt refresh when going from record to record.

Private Sub RecordLock_Click()
Me!RecordLock.Controls(0).Caption = IIf(Me.RecordLock = True, "Record
Locked", "Record Un-Locked")
End Sub

Is there some code I need to put on current or something? It holds the
check value and like I said, it does change the caption, but changes
the caption in all records and isn't record specific?

Lost in Click!

Dave
 
K

Keith Wilby

Hi all,
I have a check box on a form that when I click the checkbox, I want the
caption to change. I have this code on the click event and it works
fine with one minor detail, it changes all the records to this caption
and doesnt refresh when going from record to record.

Private Sub RecordLock_Click()
Me!RecordLock.Controls(0).Caption = IIf(Me.RecordLock = True, "Record
Locked", "Record Un-Locked")
End Sub

Is there some code I need to put on current or something? It holds the
check value and like I said, it does change the caption, but changes
the caption in all records and isn't record specific?

Lost in Click!

Dave
Try using the code in the form's on current event.

Keith.
www.keithwilby.com
 

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