User Login Form

mba_110

Registered User.
Local time
Yesterday, 23:28
Joined
Jan 20, 2015
Messages
280
Dear All,

I need to know the procedure or event code for user login form at opening.

I am working on database which is almost done and i defined tables for users with passwords.

I need to know how i can assign Login Form to be appear on opening of database no other person than listed users should be able to enter or open database without password, to enforce this i made a login form.

I hope it will not bother you...many thanks in advance.

MBA
 
You have two options, one popular and very easy to implement is to set the Start up form under
Code:
[B]Access[/B]-> [B]File [/B]-> [B]Options [/B]-> [B]Current Database[/B] ->[B] Display Form[/B] -> 
(from the dropdown) Select the form name.
The other would be to use a AutoExec Macro.
 
Many thanks Paul Eugin for your reply however, can you please tell me how to take out the close button X mark on login form because if i click on X mark on login form than i can enter in database without password and i do not want anybody open database other than registered users.


Event procedure for OK button on login form is:

Code:
Private Sub Command1_Click()
    If IsNull(Me.txtLoginID) Then
        MsgBox "Please enter Login ID", vbInformation, "Login ID Required"
        Me.txtLoginID.SetFocus
    ElseIf IsNull(Me.txtPassword) Then
        MsgBox "Please enter password", vbInformation, "Password Required"
        Me.txtPassword.SetFocus
    Else
       [COLOR=Green] 'Process the job[/COLOR]
        If (IsNull(DLookup("userLogin", "UsersList", "UserLogin='" & Me.txtLoginID.Value & " ' "))) Or _
            (IsNull(DLookup("password", "UsersList", "Password='" & Me.txtPassword.Value & " ' "))) Then
            MsgBox "incorrect LoginID or Password"
        Else
            [COLOR=Green]'MsgBox "Login ID and Password Identified"[/COLOR]
            DoCmd.OpenForm "Navigation Form"
            DoCmd.Close acForm, "Login Form"
        End If
    End If
End Sub
Do i need to do separate coding for this or any function can done the job for me.

if by code please provided it.

thanks.
 
Last edited by a moderator:
Why would they be able to open any other form? Make sure the Navigation Pane is hidden, again, you can find this under Access Options.

To answer your question, you can go to Design view of the Form, in the Property Sheet, you will have under Form tab, you will have the Property - "Close Button" set it to No.
 
Yes Paul its working fine with me.

However, their is one problem once i have unchecked navigation in access options it was working good but when i select again to navigation option and go to my database it start showing me some feint tables with following names.

1. MSysACEs
2. MSysComplexColumns
3. MSysObjects
4. MSysQueries
5. MSysRelationships

i dont know what this means but i can open it but cant delete them please advise how i can delete these from my database.
 

Users who are viewing this thread

Back
Top Bottom