Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11

    Show related record for current user

    this MS programm have 2 type user admin and employee(normal user).. what i wanna to do is when employee login and bring them to the employee form that only will show their profile.. but the problem now is it display both user type profile as well.. in this program employee username : azmi and password is : azmi .. admin login is username : admin and password : admin .. when i login as employee and when view thei profile it view admin profile as well.. i attached the ms access program with my post.. Database2.zip

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    see this for info that may help. Also Google --user login form.

  3. #3
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by orange View Post
    see this for info that may help. Also Google --user login form.
    my login form is working well since i was followed that video tutorial.. problem is when a user login, and it bring the user to a form that allowed for user.. and it should view his own record .. but not other people record

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    You will have to set a filter, or restrict the recordsource, to those records belonging to the current user.

    In overview, if you have a login screen for each user, you know the userId or userLoginId for each user. You'll need to identify which records are associated with the user logging in.

    Restrict records along this sort of thinking.

    Code:
    SELECT Records 
    FROM DataTable INNER JOIN LoginTable 
    ON DataTable.UserID = LoginTable.LoginUserId

  5. #5
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by aquilina View Post
    my login form is working well since i was followed that video tutorial.. problem is when a user login, and it bring the user to a form that allowed for user.. and it should view his own record .. but not other people record
    i got 1 login form with different userlevel admin and user.. i think i cannt get u.. u too straightfoward and i still new on this..

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Or use the form WHERE CONDITION argument of OpenForm method to filter the form when the form opens.

    What field in the form's RecordSource has the user id? What textbox on login form has user ID?

    Example:

    DoCmd.OpenForm "formname", , , "UserID='" & Me.tbxUserID

    I tried to download and open your zip file but get error the zip is invalid.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    Or use the form WHERE CONDITION argument of OpenForm method to filter the form when the form opens.

    What field in the form's RecordSource has the user id? What textbox on login form has user ID?

    Example:

    DoCmd.OpenForm "formname", , , "UserID='" & Me.tbxUserID

    I tried to download and open your zip file but get error the zip is invalid.
    ahah i got it.. but i just display the user details in the text box.. its possible display it on datasheet type? so that user can edit the details.. mind check my current progress and what should i do for next step.. me.zip since.. i cannt upload the file of the access since it exceed the size.. and i compress it into rar file and it doesnt support and i just change the extension of file to zip.. i think u should change the extension before extract.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    I can't extract from rar. Why not use Windows compression and upload a zip file?

    Display the form as Single, Continuous, or Datasheet. Any should allow edit assuming the form RecordSource is editable.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    I can't extract from rar. Why not use Windows compression and upload a zip file?

    Display the form as Single, Continuous, or Datasheet. Any should allow edit assuming the form RecordSource is editable.
    What does mean display the form as single?me.zip << this might be worked..

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Single record. Open form in design view. Look at the Default View property.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    Single record. Open form in design view. Look at the Default View property.
    im trying to play with those type of form.. when i change it to splitform .. it doesnt work..and why my navigation form is disable?

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    I've never used Split nor Navigation forms. Neither of those are in the posted db.

    Which form did you change to Split and what doesn't work when you do that?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    I've never used Split nor Navigation forms. Neither of those are in the posted db.

    Which form did you change to Split and what doesn't work when you do that?
    im creating another new form.. by using split form.. its possible? instead of showing the details in form of frmMainSwitchBoard (refer to my program).. http://prntscr.com/3j8u3o its we just edit the detail from the datasheet? or theres another better way to edit it?

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Filtering a split should be possible. You want it to show the records from tblUsers? But if you filter to a UserID there is only one record - why bother with split form for a single record?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    Filtering a split should be possible. You want it to show the records from tblUsers? But if you filter to a UserID there is only one record - why bother with split form for a single record?
    i stuck at some place where here related with two table that are tblLeave : LeaveID, TypeOfLeave, DateStart, DateEnd, LeaveStatus, Username and for another table is tblUser : UserID, username, Name and etc.. now the thing i working now is when user is login as employee and they apply for leave. I want the username from the tblLeave fetch the username from the user who login.. since i linked the tblleave and tblusers.. how i going to do?

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

Similar Threads

  1. Replies: 6
    Last Post: 11-07-2013, 04:02 PM
  2. Replies: 9
    Last Post: 10-14-2013, 02:23 PM
  3. Replies: 7
    Last Post: 07-02-2012, 10:50 PM
  4. Replies: 2
    Last Post: 05-11-2011, 02:58 PM
  5. Show only current record in report from form/subform
    By stelioshania in forum Reports
    Replies: 0
    Last Post: 03-02-2011, 02:19 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