Login screen help

jeffrey159

Registered User.
Local time
Today, 13:29
Joined
Jan 17, 2013
Messages
24
i've just created a form Login, but i want it to open up the moment i open the database, and it has to force you to login before u can click anything in it,
how do i create the code to force you to login??

when i open my ms access database, it will prompt out a pop-up window of a Login form and i have to enter my username pass in order to access the database

Question 2:

how do i code it that for permissions

example:
form1, form2,form3

Staff is able to access form1 and form2 Read-Only
Staff2 is able to access form1 and form3 Read-Only
Staff3 is able to edit Form1 but access form2 and form3 Read-Only

how do i actually make those permission? it looks kinda confusing when i have to make it like this as this is what my project wants...
 
Hello Jeffrey,
i've just created a form Login, but i want it to open up the moment i open the database,
You can do it in two ways.. An AutoExec Macro.. Or just under the Settings.. File -> Options ->Current Database -> Display Form (Select the Form you want it to open by default.
and it has to force you to login before u can click anything in it,
Under the Form properties, (Other tab) set Modal = Yes and Pop Up = Yes. This will make the form pop up and will not allow access anywhere else..
how do i code it that for permissions
You need to create a permission field in the Table where you have users and their password.. Then everytime you opena Form, you have to look for the permission field of the user and based on that you have to open the forms in either read only mode or full access..
 
@pr2-eugin

thanks for the help for question 1

but for question 2, can anyone give me a sample code of how it's done???:D
 
Hello Jeffrey, I am pretty sure there are several samples in this form regarding Login forms.. Few days ago I designed a simple Login form for another member.. This is not a great example, but should get you started.. I could not modify the code, as I do not have Access on my PC. Look into the file I am attaching, also go through the forum to help you better understand.. I hope someone will drop by to help you out, while I am away for the weekend.. Sorry..
 

Attachments

Hello Jeffrey, I am pretty sure there are several samples in this form regarding Login forms.. Few days ago I designed a simple Login form for another member.. This is not a great example, but should get you started.. I could not modify the code, as I do not have Access on my PC. Look into the file I am attaching, also go through the forum to help you better understand.. I hope someone will drop by to help you out, while I am away for the weekend.. Sorry..

Thanks for the sample, but sorry I've already done a login form, what i want is permissions, how do i code it i don't really know what to google for i tried access permission and all those stuff but not what i wanted:banghead:

Taking your sample for an example

a-pattison is only able to Edit Form3 but Read-Only Form1, Form2
a-brown is only able to edit Form2 but Read-Only Form1, Form3

how do i actually code it for each user like this??


EDIT:

i tried using macro to locate it but doesn't work.
If [Forms]![Login]![cboUsername]="Admin" Then
Open Form
Form name: Club
View: Form
Data Mode: Read Only
Window mode: normal
End if

and after i try logging in to admin and click Clubs

Error: Microsoft Access cannot find referenced form "Login"
 
Last edited:

Users who are viewing this thread

Back
Top Bottom