Help with

  • Thread starter Thread starter lushh
  • Start date Start date
L

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 resource info system_2006-09-27.zip


i do apologize for the inconvenience...
 
lushh said:
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.
 
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
 
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
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 said:
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.
 
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 said:
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]
 
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
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 said:
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]
 
ok. thanks so much for the information.. have a good day!!! =)

Joan said:
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
 
Back
Top