Design question

Hello. I need to design an app that will allow different users access to different objects. Upon users Login program should know what he / she can access. Certain users will be able to modify data others will just be able to view it. How can i allow this ? Data is stored in Access. Please suggest . Thank  you.
Who is Participating?
Add a table for the users with an access code field, then when your program runs verify each process according to this access code.


Option Explicit

Dim intUserCode As Integer

Private Sub Form_Load()
    frmLogin.Show vbModal, Me

    'load the user code from the
    'database based on the user name
    intUserCode = GetUserCode(UserName)

End Sub    

Private Function GetUserCode(S As String) As Integer
    'your code to get the code...

End Function

Private Sub cmdAdd_Click()
    'if the user isn't qualified then
    'show a message and exit the sub
    If intUserCode < FULL_ACCESS Then
        MsgBox "Access Denied"
        Exit Sub
    End If
    'otherwise, do whatever you
    'need to do...

End Sub

Below is brief description of a good design and Microsoft recommendation ...

Your application is 3-tier should be  
3 tier application.  

1. Presentation VB code;
2. Business Logic components
3. Data Components - access DB

Use MTS as components placeholder, so
BL components and Data Components put
in MTS. Use MTS role base security to
restrict access to Data Components specific users or users groups.
vbRetardAuthor Commented:
MTS is a bit too advanced for me right now. I need something simpler. To create a class object which can do something like this. I don't need anyone post the code just ideas on how i can validate or lock different portions of the program to the person who shouldn't have access to it.
Foyal's suggestion is a good one.
Thanks for the point.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.