By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 IT Pros & Developers. It's quick & easy.

Read Access & Read & Write Access

P: 23
Hi, i have another question regarding MS Access database again):

Hope i could get some help and advise! It'll be greatly appreciated.

As i have a database of records. This databse is used by 2 different teams.

My team needs Read and Write Access while another team can only be granted Read Only Access.

Is there any way i can create a Read Only Access only and grant it to the other team?

Best wishes and many thanks for the help!
Cheers,
Nicole((:
Feb 25 '10 #1

✓ answered by TheSmileyCoder

Adv. solution is to setup Security on the database, whcih can be troublesome to setup and to maintain.

The quick solution:

You could add some simple code in the form's open event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     'Check for user in table of "approved users"
  3.     If Not IsNull(DLookup("KEY_User", "tbl_ApprovedUsers", "tx_UserName='" & Environ("UserName") & "'")) Then
  4.         Me.AllowAdditions = True
  5.         Me.AllowEdits = True
  6.         Me.AllowDeletions = True
  7.     Else
  8.         Me.AllowAdditions = False
  9.         Me.AllowEdits = False
  10.         Me.AllowDeletions = False
  11.     End If
  12. End Sub
All you need to do is to create a tbl_ApprovedUsers and add the windows username of each user you want to have write access. The Environ("UserName") will return the windows username for you.

Share this Question
Share on Google+
1 Reply


TheSmileyCoder
Expert Mod 100+
P: 2,321
Adv. solution is to setup Security on the database, whcih can be troublesome to setup and to maintain.

The quick solution:

You could add some simple code in the form's open event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     'Check for user in table of "approved users"
  3.     If Not IsNull(DLookup("KEY_User", "tbl_ApprovedUsers", "tx_UserName='" & Environ("UserName") & "'")) Then
  4.         Me.AllowAdditions = True
  5.         Me.AllowEdits = True
  6.         Me.AllowDeletions = True
  7.     Else
  8.         Me.AllowAdditions = False
  9.         Me.AllowEdits = False
  10.         Me.AllowDeletions = False
  11.     End If
  12. End Sub
All you need to do is to create a tbl_ApprovedUsers and add the windows username of each user you want to have write access. The Environ("UserName") will return the windows username for you.
Feb 25 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.