I need to secure type of entry on forms (1 Viewer)

edzigns

New member
Local time
Today, 01:56
Joined
Aug 21, 2002
Messages
22
I have a operational database, but I would like to limit the type of entries my users make (we have ID's, security and view levels), but I am trying to determine the IF..ELSE statement that I would need to put in the forms and tables...

I am an administrator (Primary Key = 1)
Everyone else is a user (Primary Key = 4)

I would like to have the code work like this on all forms and tables...

If userid > 1 (add new only, no edits or deletions for tables, current/ new record view only for forms)
else if userid = 1 (full control, all records)

Can someone help me with the coding for the areas in parenthesees...

Thank you.
:confused:
 

ghudson

Registered User.
Local time
Today, 01:56
Joined
Jun 8, 2002
Messages
6,194
Try this...

Private Sub Form_Open(Cancel As Integer)
If userid = 1 then
Me.AllowAdditions = True
Me.AllowEdits = True
Me.AllowDeletions = True
Else
Me.AllowAdditions = True
Me.AllowEdits = False
Me.AllowDeletions = False
End If
End Sub

You can not control a table, only the form and how it accesses the data.

HTH
 

edzigns

New member
Local time
Today, 01:56
Joined
Aug 21, 2002
Messages
22
Thank you!

Thank you, that worked out fine....
 

Users who are viewing this thread

Top Bottom