View Full Version : Two toggle buttons with two different Captions on same form


johnhobbis
04-30-2001, 01:54 PM
I have a present a Toggle button that changes from AT RISK to NOT AT RISK using the following VB
===========================
Private Sub Form_Current()
If Me.At_Risk_Register.Value = True Then
Me.At_Risk_Register.Caption = "AT RISK"
Else
Me.At_Risk_Register.Caption = "NOT AT RISK"
End If
End Sub
====================================
Private Sub At_Risk_Register_BeforeUpdate(Cancel As Integer)
If Me.At_Risk_Register.Value = True Then
Me.At_Risk_Register.Caption = "AT RISK"
Else
Me.At_Risk_Register.Caption = "NOT AT RISK"
End If
End Sub
===============================
The Problem --- I have to have another Toggle button with a different captions but cannot use the Form_current again.

It must appear on the same form

2nd button name = Discharge_button, captions "Discharge", "Click to Discharge"

Can anyone help Please??

Rich
04-30-2001, 02:43 PM
Why can't you use the form's current event and why do you use the same code twice? In the after update of At_Risk_Register just put Form_Current.
HTH