Hi
I have a group frame on a form with 3 toggle buttons, the following code does not work for and results in "You entered an expression that has no value", can some please help me in coding it correctly - thanks.
Private Sub btnOK_Click()
On Error GoTo Err_btnOK_Click
Dim vOpt1 As Boolean
Dim vOpt2 As Boolean
If Me.tglBOTH.Value = True Then
vOpt1 = True
vOpt1 = True
End If
If Me.tgl1.Value = True Then
vOpt2 = False
vOpt1 = True
End If
If Me.tgl2.Value = True Then
vOpt1 = False
vOpt2 = True
End If
MsgBox "Toggle 1 is set to : " & vOpt1 & vbCrLf & _
"Toggle 2 is set to : " & vOpt2
Exit_btnOK_Click:
Exit Sub
Err_btnOK_Click:
MsgBox Err.Description
Resume Exit_btnOK_Click
End Sub
I have a group frame on a form with 3 toggle buttons, the following code does not work for and results in "You entered an expression that has no value", can some please help me in coding it correctly - thanks.
Private Sub btnOK_Click()
On Error GoTo Err_btnOK_Click
Dim vOpt1 As Boolean
Dim vOpt2 As Boolean
If Me.tglBOTH.Value = True Then
vOpt1 = True
vOpt1 = True
End If
If Me.tgl1.Value = True Then
vOpt2 = False
vOpt1 = True
End If
If Me.tgl2.Value = True Then
vOpt1 = False
vOpt2 = True
End If
MsgBox "Toggle 1 is set to : " & vOpt1 & vbCrLf & _
"Toggle 2 is set to : " & vOpt2
Exit_btnOK_Click:
Exit Sub
Err_btnOK_Click:
MsgBox Err.Description
Resume Exit_btnOK_Click
End Sub