Tuesday, November 18, 2014

Created A LogOn Form.


Private Sub Form_Open(Cancel As Integer)
Form.DataEntry = True
End Sub

--------------------------------------------------------------------------------------------------------------

Private Sub Form_Timer()
Me.Label8.Caption = Time()
Me.Label8.Width = 1000
Me.Label8.Height = 1500

Label8.Left = Int(3500 * Rnd)
Label8.Top = 2000 * Rnd
End Sub

--------------------------------------------------------------------------------------------------------------

Private Sub Ok_Click()
On Error GoTo Err_Ok_Click
If UserName = "nazir" And Pasword = 1836 Then
UserNameLabel.ForeColor = 0
PaswordLabel.ForeColor = 0
    DoCmd.OpenForm "LoaneeInformationNew", acNormal
       Me.Date.Value = Date
       Else
            Me.Visible = True
           
    End If
If UserName <> "nazir" Or Pasword <> 1836 Or IsNull([UserName]) Or IsNull([Pasword]) Then
UserNameLabel.ForeColor = 255
PaswordLabel.ForeColor = 255
DoCmd.GoToControl "UserName"
    MsgBox "Your User Name or Password uncorrect. Pleas Entry Correct User Name or Password"
 Else
            Me.Visible = False
End If

Exit_Ok_Click:
    Exit Sub

Err_Ok_Click:
    MsgBox Err.Description
    Resume Exit_Ok_Click
   

End Sub

--------------------------------------------------------------------------------------------------------------

Private Sub Exit_Click()
On Error GoTo Err_Exit_Click
If UserName <> "nazir" Or Pasword <> 1836 Or IsNull([UserName]) Or IsNull([Pasword]) Then
MsgBox "You can this application Quit Now"
    DoCmd.Quit
End If

If UserName = "nazir" And Pasword = 1836 Then
DoCmd.Close
End If
Exit_Exit_Click:
    Exit Sub

Err_Exit_Click:
    MsgBox Err.Description
    Resume Exit_Exit_Click
   
End Sub

--------------------------------------------------------------------------------------------------------------

Private Sub Pasword_Enter()
If UserName = "nazir" Then
Label6.Caption = "Created by_MOHAMMAD NAZIRUL ISLAM"
End If
If UserName <> "nazir" Then
Label6.Caption = "User Name are Wrong"
End If
End Sub

No comments:

Post a Comment