I have a user form that has a toggle button which activates(shows) another userform with the following code
Code:
Private Sub tglSubLog_Click()
fmSubLog.Show
End Sub
and laters acts as a condition check in my code. In the second userfrom I have a command button for Cancel which has code in a commandbutton_Click routine.
Code:
Private Sub cmdCancel_Click()
'close fmSubLog
Unload Me
'reset Insert Submittal Log toggle button to false
fmSheetBuilder.tglSubLog.Value = False
End Sub
in order to to completely close the userform with this as the cancel code I have to hit the cancel button twice.
if I write that same code like this;
Code:
Private Sub cmdCancel_Click()
'reset Insert Submittal Log toggle button to false
fmSheetBuilder.tglSubLog.Value = False
'close fmSubLog
Unload Me
End Sub
I get a "Runtime error 400: Form already displayed; can't show modally." I understand what is happening in the code it is looking at the change to false under the cancel code and reading that as a click it and trying to show the userform a second time.
Now this was working fine last week, today it is not, how can I fix this.