Hi guys, i would like to combine the codes below so that you can only double click when you are logged in;
How do i do that?
Thanks in advance
Code:
Private Sub cmdLogin_Click()
If txtPassword.Value = "1" And txtUsername.Text = "ROH1" Then
With AdvancedInformation
.lblInformation.Visible = False
.cmdLogin.Enabled = False
.cmdCancel.Enabled = True
.cmdCancel.SetFocus
.lblAdministrator.Caption = "Hello administrator," & vbNewLine & "Double-click the values that you would like to change." & vbNewLine & "Changes are automatically saved."
'Page(s)
'Show border and change it's colour to blue
.lblPagesR.BorderStyle = fmBorderStyleSingle
.lblPagesR.BorderColor = RGB(0, 0, 255)
.lblInputfieldR.BorderStyle = fmBorderStyleSingle
.lblInputfieldR.BorderColor = RGB(0, 0, 255)
.lblChecksR.BorderStyle = fmBorderStyleSingle
.lblChecksR.BorderColor = RGB(0, 0, 255)
.lblDoubleCheckR.BorderStyle = fmBorderStyleSingle
.lblDoubleCheckR.BorderColor = RGB(0, 0, 255)
.lblRMcodesR.BorderStyle = fmBorderStyleSingle
.lblRMcodesR.BorderColor = RGB(0, 0, 255)
.lblBatchnumbersR.BorderStyle = fmBorderStyleSingle
.lblBatchnumbersR.BorderColor = RGB(0, 0, 255)
.lblRoomnumbersR.BorderStyle = fmBorderStyleSingle
.lblRoomnumbersR.BorderColor = RGB(0, 0, 255)
'Weighing form(s)
'Show border and change it's colour to blue
.lblWeighingformsR.BorderStyle = fmBorderStyleSingle
.lblWeighingformsR.BorderColor = RGB(0, 0, 255)
.lblInputFields1R.BorderStyle = fmBorderStyleSingle
.lblInputFields1R.BorderColor = RGB(0, 0, 255)
.lblRoomnumbers1R.BorderStyle = fmBorderStyleSingle
.lblRoomnumbers1R.BorderColor = RGB(0, 0, 255)
.lblDatesR.BorderStyle = fmBorderStyleSingle
.lblDatesR.BorderColor = RGB(0, 0, 255)
.lblENScodesR.BorderStyle = fmBorderStyleSingle
.lblENScodesR.BorderColor = RGB(0, 0, 255)
.lblSignsR.BorderStyle = fmBorderStyleSingle
.lblSignsR.BorderColor = RGB(0, 0, 255)
End With
Unload Me
Else
If MsgBox("The username and/or password is incorrect. Please try again.", vbYesNo) = vbNo Then
Unload Me
Else
txtUsername.Text = ""
txtPassword.Text = ""
txtUsername.SetFocus
End If
End If
End Sub
Code:
Private Sub lblPagesR_DblClick(ByVal Cancel As MSForms.ReturnBoolean)Dim stCaption As String
stCaption = InputBox("Add new caption", , lblPagesR)
If stCaption = vbNullString Then Exit Sub
lblPagesR = stCaption
End Sub
How do i do that?
Thanks in advance