Can you please just answer my question, with words not jumbled images?
Userform1 - Login form
Private Sub CommandButton1_Click()
Dim user As String
Dim password As String
user = Me.txtUserID.Value
password = Me.txtPassword.Value
If (user = "admin" And password = "admin") Or (user = "user" And password = "user") Or (user = "Dario" And password = "Dario") Then
Unload Me
Application.Visible = True
Else
If LoginInstance < 3 Then
MsgBox "Invalid login credentials. Please try again.", vbOKOnly + vbCritical, "Invalid Login Details"
LoginInstance = LoginInstance + 1
Else
MsgBox "You have exceeded the maximum number of login attempts.", vbOKOnly + vbCritical, "Invalid Credentials"
Unload Me
ThisWorkbook.Close Savechanges:=False
Application.Visible = True
LoginInstance = 0
End If
End If
End Sub
Module -Appl.-Form
Sub Submit()
Dim sh As Worksheet
Dim iRow As Long
Set sh = ThisWorkbook.Sheets("Database")
If frmForm.txtRowNumber.Value = "" Then
iRow = [Counta(Database!A:A)] + 1
Else
iRow = frmForm.txtRowNumber.Value
End If
With sh
.Cells(iRow, 1) = "=Row()-1" 'Dynamic Serial Number
.Cells(iRow, 2) = frmForm.txtMaterialID.Value
.Cells(iRow, 3) = IIf(frmForm.optLarge.Value = True, "Large", "Small")
.Cells(iRow, 4) = frmForm.cmbValve.Value
.Cells(iRow, 5) = IIf(frmForm.CheckYes.Value = True, "Yes", "No")
.Cells(iRow, 6) = frmForm.txtintfineflow.Value
.Cells(iRow, 7) = frmForm.txtintcoarseflow.Value
.Cells(iRow, 8) = frmForm.txtFineFlow.Value
.Cells(iRow, 9) = frmForm.txtCoarseFLow.Value
.Cells(iRow, 10) = UserForm1.txtUserID.Value
.Cells(iRow, 11) = [Text(Now(), "MM-DD-YYYY HH:MM:SS")]
.Cells(iRow, 12) = frmForm.txtComments.Value
End With
End Sub