Results 1 to 2 of 2
  1. #1
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37

    Password logon form

    Hi All, my db is running ok but i need to make a change which i am having a real


    problem with.


    My main form frmReactiveTracker has a combo box cboClientSearch which when a client


    is selected filters the db for that user. It is unbound and has a query qryClient


    feeding in the client names.


    After updating the client choice in this combo i am using this code to filter the


    db.




    Option Compare Database
    Option Explicit




    Private Sub cboClientSearch_AfterUpdate()
    On Error GoTo errHandler




    Me.cboOrderNoSerach = Null


    With Me.RecordsetClone
    .FindFirst "[ClientID] = " & Me.cboClientSearch

    TabCtl86.Visible = True

    TabCtl86.Pages(0).SetFocus





    If .NoMatch Then

    MsgBox "No records match your search criteria", vbOKOnly





    Else
    Me.Bookmark = .Bookmark


    End If
    End With
    End Sub




    What i am trying to do now is introduce a password form to control what records a


    user can see when they log in. I have been trying various password samples but have


    not yet figured how to do it. The example i am trying to use is this one (attached)


    from DatabaseDev website there are others i'm sure. The point i get stuck with is getting the filter to work when i click on the command button on the password form.


    Your valued assistance would be very much apreciated.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,997
    I have a tUser table.
    ID, PASS, RIGHTS
    bsmith, bear123, "A"

    when they click the button to open the form, it pulls their user id, and checks the password they enter.
    then the Rights code , determines if they can view it. I put the codes on the forms TAG property. IF its there they can open it , edit , or view only depending on the code,
    Code:
    vUsr =  Environ("Username")
    if Dlookup("[UserID]","tUsers","[userid]='" & vUsr & "'") = vUsr then
       if Dlookup("[Pass]","tUsers","[userid]='" & vUsr & "'") = txtPassword then
           msgbox "Invalid password"
       else
            vRights = Dlookup("[Rights]","tUsers","[userid]='" & vUsr & "'") 
          docmd.openForm cboForm   'picked from a list
          if forms(cboForm).Tag ,vRights) =0 then
               docmd.close acForm, cboform
               msgbox "No rights to this form"
          else
                'check other rights here
          endif
       endif
    else
       msgbox "User not on file"
    endif

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to show the UNC path behind a logon form?
    By ashley11041961 in forum Programming
    Replies: 3
    Last Post: 09-17-2014, 11:42 AM
  2. Replies: 2
    Last Post: 12-24-2012, 10:15 PM
  3. Replies: 1
    Last Post: 06-22-2012, 08:05 AM
  4. Logon form
    By Andyjones in forum Forms
    Replies: 5
    Last Post: 09-13-2011, 01:58 PM
  5. XP Logon type form
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-31-2010, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums