I have 2 command buttons, 1 which opens a userform and enables the user to scroll through the records and amend them, and another which opens the userform but only allows the user to make a new entry.
This is done by enabling/disabling a combobox.
The problem I am having is that I have to seemingly run the macro twice for it to take effect. Any ideas why this might be?
Here are the 2 codes
Editable
Create New only
This is done by enabling/disabling a combobox.
The problem I am having is that I have to seemingly run the macro twice for it to take effect. Any ideas why this might be?
Here are the 2 codes
Editable
Code:
Sub ViewForm()
Dim pword As String
pword = InputBox("Please enter the password:")
If pword <> "mypassword" Then
MsgBox "Incorrect password"
Else
UserForm1.Show
End If
End Sub
Create New only
Code:
Sub NewForm()
UserForm1.Show
UserForm1.cboAccidentID.Enabled = False
End Sub