Hide all (Tables, Queries, Forms etc)

wrightyrx7

Registered User.
Local time
Today, 15:00
Joined
Sep 4, 2014
Messages
104
Hi all,

I have successfully made a Login form, and now its time to put in some sort of permissions.

I have a table called 'Users' with a filed called 'Access Type', there are to choices in this field 'Admin' or 'User'

I want to HIDE/LOCK as much as I can in access (Tables, Queries, Forms, Ribbon etc) if a 'User' logs in. But Show Everything if an admin logs in.

Any help would be great.


This is my basic 'Login' form code:

Code:
Private Sub Command1_Click()
    If IsNull(Me.txtLoginID) Then
        MsgBox "Please enter a Login ID", vbInformation, "Login ID Required"
        Me.txtLoginID.SetFocus
    ElseIf IsNull(Me.txtPassword) Then
        MsgBox "Please enter a Password", vbInformation, "Password Required"
        Me.txtPassword.SetFocus
    Else
        If (IsNull(DLookup("[Login ID]", "[Users Extended]", "[Login ID]='" & Me.txtLoginID.Value & "'  and Password='" & Me.txtPassword.Value & "'"))) Then
            MsgBox "Incorrect Login ID or Password."
        Else
            cUser = DLookup("[Username]", "[Users Extended]", "[Login ID]='" & Forms![Login]!txtLoginID.Value & "'")
            DoCmd.Close acForm, "Login", acSaveNo
            DoCmd.OpenForm "Call Log"
        End If
    End If
End Sub
Regards
Chris
 
I realize this is an OLD version of Access.
That said, the advice and steps for the older versions were well written.
Read this, then look up a newer version.
Each of the things in this article have a parallel in the most recent version.

http://msdn.microsoft.com/en-us/library/office/aa200349(v=office.11).aspx

You want a Start form that navigates (opens and closes) the other forms, hiding the object bar.

Also, on this forum - be sure and look at the Sample Database
There are some that can help with ideas that fit your need.
 
Hi Rx_,

Im using Access 2010. The code i have about is code I found online.

I will have a read through the information in you link.

Many thanks for the reply.
 

Users who are viewing this thread

Back
Top Bottom