Home All Groups Group Topic Archive Search About
Author
3 Oct 2006 1:01 PM
lushh
I am currently creating an employee database, and there will be an admin and
a read-only user for this database.  what should i do if i want the
administrator to be the only one who can edit records, while the rest can
only view the records. a friend told me that i should set permissions through
writing codes and routines on form_load. if you want to see the structure of
my database, here is the link:

http://www.gigafiles.co.uk/files/636/HRIS/human%20resource%20info%20system_2006-09-27.zip


i do apologize for the inconvenience...


Author
3 Oct 2006 2:48 PM
Joan Wild
lushh wrote:
> I am currently creating an employee database, and there will be an
> admin and a read-only user for this database.  what should i do if i
> want the administrator to be the only one who can edit records, while
> the rest can only view the records. a friend told me that i should
> set permissions through writing codes and routines on form_load. if
> you want to see the structure of my database, here is the link:

You can implement user level security.  In your case, since there is only
one admin group, you can secure it so that users will use their standard
system.mdw workgroup.  The people in the admin group would use the workgroup
file you secured it with.

See www.jmwild.com/SecureNoLogin.htm for more information.

You would just give read permission to the necessary objects for the Users
Group.

--
Joan Wild
Microsoft Access MVP
Author
4 Oct 2006 1:18 AM
lushh via AccessMonster.com
thanks for the reply...

i have a log-in form that looks like this:

http://i114.photobucket.com/albums/n258/lushh_16/loginpic.jpg

and with this code:

Option Compare Database


Private Sub cboUsername_AfterUpdate()

    Me.txtPassword.SetFocus
End Sub

Private Sub cmdLogin_Click()


If IsNull(Me.cboUsername) Or Me.cboUsername = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboUsername.SetFocus
Exit Sub
End If


If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If


If Me.txtPassword.Value = DLookup("Password", "Users", "[UserID]=" & Me.
cboUsername.Value) Then

MyUserID = Me.cboUsername.Value

DoCmd.Close acForm, "frmLogIn", acSaveNo
DoCmd.OpenForm "frmMainMenu"
DoCmd.Restore

Else

MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If

End Sub

Private Sub Form_Load()
DoCmd.Restore

End Sub

Private Sub Form_Open(Cancel As Integer)

Me.cboUsername.SetFocus

End Sub

Joan Wild wrote:
Show quoteHide quote
>> I am currently creating an employee database, and there will be an
>> admin and a read-only user for this database.  what should i do if i
>> want the administrator to be the only one who can edit records, while
>> the rest can only view the records. a friend told me that i should
>> set permissions through writing codes and routines on form_load. if
>> you want to see the structure of my database, here is the link:
>
>You can implement user level security.  In your case, since there is only
>one admin group, you can secure it so that users will use their standard
>system.mdw workgroup.  The people in the admin group would use the workgroup
>file you secured it with.
>
>See www.jmwild.com/SecureNoLogin.htm for more information.
>
>You would just give read permission to the necessary objects for the Users
>Group.
>

--
Message posted via http://www.accessmonster.com
Author
4 Oct 2006 2:10 AM
Joan Wild
I'm not sure what your question is?  So you are rolling your own security.

Although Access security can be broken into, anything you build yourself
will never be as secure as you can do with the security built into Access.
I suggest you read up on it
http://support.microsoft.com/?id=207793


--
Joan Wild
Microsoft Access MVP

lushh via AccessMonster.com wrote:
Show quoteHide quote
> thanks for the reply...
>
> i have a log-in form that looks like this:
>
> http://i114.photobucket.com/albums/n258/lushh_16/loginpic.jpg
>
> and with this code:
>
> Option Compare Database
>
>
> Private Sub cboUsername_AfterUpdate()
>
>    Me.txtPassword.SetFocus
> End Sub
>
> Private Sub cmdLogin_Click()
>
>
> If IsNull(Me.cboUsername) Or Me.cboUsername = "" Then
> MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
> Me.cboUsername.SetFocus
> Exit Sub
> End If
>
>
> If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
> MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
> Me.txtPassword.SetFocus
> Exit Sub
> End If
>
>
> If Me.txtPassword.Value = DLookup("Password", "Users", "[UserID]=" &
> Me. cboUsername.Value) Then
>
> MyUserID = Me.cboUsername.Value
>
> DoCmd.Close acForm, "frmLogIn", acSaveNo
> DoCmd.OpenForm "frmMainMenu"
> DoCmd.Restore
>
> Else
>
> MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid
> Entry!" Me.txtPassword.SetFocus
> End If
>
> End Sub
>
> Private Sub Form_Load()
> DoCmd.Restore
>
> End Sub
>
> Private Sub Form_Open(Cancel As Integer)
>
> Me.cboUsername.SetFocus
>
> End Sub
>
> Joan Wild wrote:
>>> I am currently creating an employee database, and there will be an
>>> admin and a read-only user for this database.  what should i do if i
>>> want the administrator to be the only one who can edit records,
>>> while the rest can only view the records. a friend told me that i
>>> should set permissions through writing codes and routines on
>>> form_load. if you want to see the structure of my database, here is
>>> the link:
>>
>> You can implement user level security.  In your case, since there is
>> only one admin group, you can secure it so that users will use their
>> standard system.mdw workgroup.  The people in the admin group would
>> use the workgroup file you secured it with.
>>
>> See www.jmwild.com/SecureNoLogin.htm for more information.
>>
>> You would just give read permission to the necessary objects for the
>> Users Group.
>>
>
> --
> Message posted via http://www.accessmonster.com
Author
4 Oct 2006 6:21 AM
lushh via AccessMonster.com
oh i'm sorry. i was just wondering if your previous advice will work even if
i have my own log-in screen. thanks for the link. i do appreciate it. thank
you so much for your time.. and sorry for the inconvenience...

Joan Wild wrote:
>I'm not sure what your question is?  So you are rolling your own security.
>
>Although Access security can be broken into, anything you build yourself
>will never be as secure as you can do with the security built into Access.
>I suggest you read up on it
> http://support.microsoft.com/?id=207793
>
>> thanks for the reply...
>>
>[quoted text clipped - 73 lines]
>> --
>> Message posted via http://www.accessmonster.com

Author
4 Oct 2006 1:42 PM
Joan Wild
CurrentUser() only works if you have used the built-in user security.  There
is code at
http://www.mvps.org/access/api/api0008.htm
you can use to get the user's window's login name.


--
Joan Wild
Microsoft Access MVP

lushh via AccessMonster.com wrote:
Show quoteHide quote
> oh i'm sorry. i was just wondering if your previous advice will work
> even if i have my own log-in screen. thanks for the link. i do
> appreciate it. thank you so much for your time.. and sorry for the
> inconvenience...
>
> Joan Wild wrote:
>> I'm not sure what your question is?  So you are rolling your own
>> security.
>>
>> Although Access security can be broken into, anything you build
>> yourself will never be as secure as you can do with the security
>> built into Access. I suggest you read up on it
>> http://support.microsoft.com/?id=207793
>>
>>> thanks for the reply...
>>>
>> [quoted text clipped - 73 lines]
>>> --
>>> Message posted via http://www.accessmonster.com
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-security/200610/1
Author
6 Oct 2006 2:22 AM
lushh via AccessMonster.com
ok. thanks so much for the information.. have a good day!!! =)

Joan Wild wrote:
Show quoteHide quote
>CurrentUser() only works if you have used the built-in user security.  There
>is code at
> http://www.mvps.org/access/api/api0008.htm
>you can use to get the user's window's login name.
>
>> oh i'm sorry. i was just wondering if your previous advice will work
>> even if i have my own log-in screen. thanks for the link. i do
>[quoted text clipped - 18 lines]
>> Message posted via AccessMonster.com
>> http://www.accessmonster.com/Uwe/Forums.aspx/access-security/200610/1

--
Message posted via http://www.accessmonster.com