Results 1 to 6 of 6

Thread: Simple Login

  1. #1
    Join Date
    Aug 2004
    Posts
    36

    Unanswered: Simple Login

    Hi all,

    I would like to create a simple login system for my db whereby users differentiated by approvers (people who approve PO forms) or preparers (people who prepare PO forms). The problem is, I do not know where to carry on after creating the form for login. How do I go about doing it? I have seen some samples but I do not really understand the code. Hope that someone will be able to guide me along. Thanks a million.

    Regards,
    Swee

  2. #2
    Join Date
    Dec 2003
    Posts
    268

    A couple idears

    First thing:
    Create a table with the user name, login, pw and thier access

    Second thing:
    Come up with a methodology for comparing the user pw to what they entered. YOu can create a user class, then store the user information in this object. Each class can do the verification etc of its user and allow a user to procede in the project. This is a little more complicated solution.

    The other solution is to simply do a comparison of the user ID and thier entered password, If that is OK then for each subsequent form control their access by referring back to a global variable.

    If none of this makes sense, look at getting a good access book that can explain some of these ideas.

    HTH

    MW

  3. #3
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404

    Login

    I have to say I've used the method suggested by mjweyland on a few databases. It's fairly simple to implement - I sually have an access level as 1,2,3 etc. All I have to decide is which way the priority goes 1- highest or lowest.

    I also use get and set functions in modules to set and retrieve the global variables.

    It really is simple once you get started.

  4. #4
    Join Date
    Dec 2003
    Posts
    268

    Next Step

    Ryker,

    YOu may want to make that next step and start creating classes to store/access this information. You don't have to reference the global variables, makes your code a lot cleaner and is far more scalable. You can also handle all password control (update, change etc) from the object.. You need only create a global object and you can reference that several times. No need for set and get methods in some general module.

    i.e.
    some module
    Public U as User

    on a corrent forms load event you can call another private event:

    private sub showStuff(Access as integer)

    select case Access
    case 1
    show some controls
    case 2
    show some other controls
    case 3
    show all other controls
    case else
    msgbox "This should never happen, Danger Will Robinson"
    end select

    Then on the load event you can call the method
    showstuff(U.access)

    Boom your done.

    Or if you want to get even more fancy you can create a table for each form listing the controls and what the greatest access is for that control and just cycle through the controls. But that is another story for another day.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by machix
    Hi all,

    I would like to create a simple login system for my db whereby users differentiated by approvers (people who approve PO forms) or preparers (people who prepare PO forms). The problem is, I do not know where to carry on after creating the form for login. How do I go about doing it? I have seen some samples but I do not really understand the code. Hope that someone will be able to guide me along. Thanks a million.

    Regards,
    Swee

    Have you looked into the built-in security features of Access itself? I hear it's pretty good and you can set up user levels and all. Never did it myself yet but hear it works well. Not sure of the complexity of it.

    just my input and have a nice day,
    Bud

  6. #6
    Join Date
    Aug 2004
    Posts
    36
    Thanks for the advice given by everyone. I have managed to compare the pwd entered by the users with the ones stored in the db. I have also given them different levels of identification such as preparers, recommenders and approvers. I have another question that has set me thinking but unfortunately, no breakthrough so far. Let's say a user who has an id of "preparer" logs in. She goes on to prepare a PO form and then continues to go to generate a report of the form.

    My question is how does she map her signature from the db and place it in the report before printing it out. The report has a few textboxes for different personnel. One for preparer, a few for recommender and one for approval. How do I place the signature image into the designated textbox for the person who has logged in?

    Thanks so much,
    Swee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •