Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    As I understand your code, this line:
    strRole = DLookup("access_level", "user", "[UserID]'" & Me.cboUser.Value & "'")
    needs to be changed to:
    strRole = DLookup("access_level", "user", "[UserID]='" & Me.cboUser.Value & "'")
    to set a value for strRole but once that is done I can't see where or how you are using strRole.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  2. #17
    Nashaath is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    10
    Private Sub cmdLogin_Click()
    Dim dbs As Database
    Dim rstUserPwd As Recordset
    Dim bFoundMatch As Boolean

    Set dbs = CurrentDb

    Set rstUserPwd = dbs.OpenRecordset("qryUserPwd")

    bFoundMatch = False

    If rstUserPwd.RecordCount > 0 Then
    rstUserPwd.MoveFirst

    Do While rstUserPwd.EOF = False
    If rstUserPwd![UserID] = Form_frm_login.txtuser_id.Value And rstUserPwd![Password] = Form_frm_login.txtPassword.Value Then
    bFoundMatch = True
    Exit Do
    End If
    rstUserPwd.MoveNext
    Loop

    End If

    If bFoundMatch = True Then
    DoCmd.Close acForm, Me.Name
    DoCmd.OpenForm "main_menu"

    Else
    '
    MsgBox "Incorrect username or password"

    End If

    rstUserPwd.Close

    End Sub



    ------

    now i can succefully login..but i need to open 2 switchboards, 1 is for admin other is for users..plz help me to do this

  3. #18
    Nashaath is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    10
    is there anycode that i can hide switchboard buttons to some users

  4. #19
    Nashaath is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    10
    is there anycode that i can hide switchboard buttons to some users

  5. #20
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    How will you decide which buttons to hide from each possible user.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Login for a form. MACRO
    By louissmith in forum Access
    Replies: 0
    Last Post: 05-04-2012, 03:54 AM
  2. Replies: 1
    Last Post: 12-11-2011, 11:48 AM
  3. Login form with nt login
    By hitesh_asrani_j in forum Forms
    Replies: 6
    Last Post: 09-22-2011, 11:43 AM
  4. Login to a form?
    By tandkb in forum Forms
    Replies: 0
    Last Post: 04-25-2011, 06:05 PM
  5. Login Form
    By Kookai in forum Access
    Replies: 3
    Last Post: 10-18-2010, 04:23 PM

Posting Permissions

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