troubleshooting Question

Help to use AllowAdditions, AllowDeletions and AllowEdits

Avatar of hassan momo
hassan momo asked on
Microsoft Access
5 Comments1 Solution133 ViewsLast Modified:
Dear friends,

Please, I want to use AllowAdditions, AllowDeletions and AllowEdits for a form of mine, but I just don't

know how to create a VB code to do it.

Here's my case...
I have a form I use to enter the username and his password, I'm gonna call it "frmlogon".

The frmlogon has:

- a combobox with a dropdown to choose a username;
- a textbox for the password input;
- when i press enter it verifies the username/password confirmation and then opens the MainForm (if password matches, offcourse! If not, there's a MsgBox for it.)

I've already done this! It's working pretty fine! The point is... Each username has a kind of "permission" to handle the MainForm.
i have a table named "tblUsers"
uUserID      uFirstName      uLastName      uPassword      uSecurityID
1      reception            ***      1
3      ADMIN            ***      9
6      security            ***      1
so if you please i want
Users with uSecurityID 1 - Can add only
Users with uSecurityID 9 - Can add and edit and delete.
Users with uSecurityID 8 - Can add only
or any other way regardless the uSecurityID
How do I do that? I've seen something like this...
If intUserID = 1 Then
Me.Form.AllowAdditions = True
Me.Form.AllowDeletions = True
Me.Form.AllowEdits = True
ElseIf intUserID = 2 Then
Me.Form.AllowAdditions = True
Me.Form.AllowDeletions = True
Me.Form.AllowEdits = False

But I confess, I didn't understand how to use it, how to design the code structure.
Please, if someone could help me, I would really appreciate it.
i attached the database and the password for any user is 123
Thanks everyone for your attention.
security-database-test.accdb
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros