I'm trying to create a command button that will perform one action on the first click and another action on the second click. I tried to accomplish it by using a variable but I think the variable is resetting each time causing a loop. I'm thinking I should move the variable declaration and set value but don't know where to put it or how to declare a Public variable. My code is below:
Thanks in advance
Code:
Private Sub ToggleReturnMode_Click()
Dim tgl As String
tgl = "First"
If tgl = "First" Then
[sfrm_Edit_Sales_Details].Controls("Returned").ColumnHidden = False
MsgBox "Check Returned Checkbox for each item to return and click this button again.", vbOKOnly
tgl = "Second"
Else
MsgBox "Code for second click runs", vbOKOnly
End If
End Sub
Comment