Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Security Password Solution
Robert Lilly 
   
16 years ago
We have a solution to the Security Password problem , I've been having. Thanks to one of her fellow students, MICAH, he revised the code listed below, his remarks are included. Now I want to share this with everyone.
The password portion of this program is simple and straightforward and is a good tool to use for anybody who just wants to employ simple password protection without a lot of code.
If anybody wants a copy of the sample database send me(Bob Lilly) an e-mail at [email protected] and I will forward it to you.



Option Compare Database
Private Sub Command19_Click()
    DoCmd.Quit
End Sub
Private Sub Command16_Click()
    If IsNull(txtUsername) Then
        MsgBox "Invalid username"
        FeedbackToUser.Caption = "Invalid username. Please enter a proper Username" 'i added this caption other than another message box. More than one message box might confuse some users
        FeedbackToUser.Visible = True
        DoCmd.GoToControl "txtUsername" 'i added this VBA code to enable the user go to the control where the problem is
        Exit Sub
    End If
    If IsNull(txtPassword) Then
        MsgBox "Invalid password"
        FeedbackToUser.Caption = "Invalid password. Please enter a proper Password"
        FeedbackToUser.Visible = True
        DoCmd.GoToControl "txtPassword" 'i added this VBA code to enable the user go to the control where the problem is
        Exit Sub
    End If    
    Dim X As Long
    X = Nz(DLookup("UserID", "UserT", "Username='" & txtUsername & "' And Password='" & txtPassword & "'"))  

If X > 0 Then
        ' We have a valid user
        FeedbackToUser.Caption = "Log In Successful"
        FeedbackToUser.Visible = True
        DoCmd.OpenForm "MainMenuF"
        DoCmd.Close acForm, "LoginF"
    Else
        MsgBox "Invalid Logon"
        FeedbackToUser.Caption = "Please enter a proper Username or the Password"
        FeedbackToUser.Visible = True
    End If          
    'DoCmd.Close acForm, "LoginF" 'this is the line that was disturbing you. I freezed up        
End Sub
Private Sub Form_Open(Cancel As Integer)
    FeedbackToUser.Visible = False 'hide the message when the form opens
End Sub
Private Sub txtPassword_BeforeUpdate(Cancel As Integer)
End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/24/2026 8:23:30 AM. PLT: 1s