Change Caption on a label

C

Clyde Ellingwood

I have a main form with a tab control that contains a
few other forms. One of the forms allows a user to either
transfer information from the previous record or not. On
this form I have a check box that does a Dlookup to a
table to determine if the value is true or false. This
value is set from another form into a preference table
(done from a custom menu option). If the user changes the
option, on close I requery the check box(this is hidden)
on the other form that adds records and would like to
change the caption on a text label to inform the user
the "Transfer Process is on or off".

So far I've been unable to get this to work.

Sorry this is so "wordie"!

Clyde
 
G

Guest

In the AfterUpdate event on your checkbox you can add code to change the
label caption.

If (Me.MyCheckbox = -1) Then
Me.MyLabel.Caption = "Transfer Process On"
End If
If (Me.MyCheckbox = 0) Then
Me.MyLabel.Caption = "Transfer Process Off"
End If
 
D

Douglas J. Steele

Better would be

If (Me.MyCheckbox = -1) Then
Me.MyLabel.Caption = "Transfer Process On"
Else
Me.MyLabel.Caption = "Transfer Process Off"
End If

or, in a single statement,

Me.MyLabel.Caption = IIf(Me.MyCheckbox, "Transfer Process On", "Transfer
Process Off")
 
C

Clyde Ellingwood

-----Original Message-----
Better would be

If (Me.MyCheckbox = -1) Then
Me.MyLabel.Caption = "Transfer Process On"
Else
Me.MyLabel.Caption = "Transfer Process Off"
End If

or, in a single statement,

Me.MyLabel.Caption = IIf(Me.MyCheckbox, "Transfer Process On", "Transfer
Process Off")

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



(e-mail address removed)...


.
I tried both your suggestions and both did not work on
the afterupdate for the check box. My original message
was long, but the control source for the checkbox is not
the table recordsource for the form but another table in
which I do a Dlookup to get the value.

Thanks...Clyde
 

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