Mar 21 2020 07:57 AM
I have made a user login form in Excel 2019, using following code:
Private Sub CommandButton1_Click()
If TextBox1.Text = Sheets("D").Range("I14") And TextBox2.Text = Sheets("D").Range("J14") Then
MsgBox "Welcome to Ambipix Accounting System"
Application.Visible = True
Unload Me
Sheets("DB").Select
Range("A2").Select
Else
MsgBox "Username or Password is incorrect"
Unload UserForm1
UserForm1.Show
End If
End Sub
But, the problem is that, if i close the form by "QueryClose", in the time of next opening the, User login login form is not opening, rather the workbook opens.
To stop opening the workbook i tried the code:
Private Sub Workbook_Open()
Application.Visible = False
UserForm1.Show
End Sub
But, still problem is not solved.
Can someone help me in this case?
Mar 23 2020 03:51 AM