Results 1 to 11 of 11
  1. #1
    Gothyx is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    6

    Issue with Login Programming and User Based Settings

    Hello,

    I'm a bit new here and I'm now on something that's got me entirely stumped.

    I have a login form set up, that after the user logs in, it will bring them to the dashboard to do whatever it is they need to do. Recently I added User Settings, that would personalize their experience within the program. Well, the issue I've run into, is that it appears that the login form maybe isn't storing the session or what user has logged in, so whenever any user changes, for example, the color theme, it's changing my account's theme rather than theirs, so it's only changing the theme of the first account and I am just entirely stumped at this point as to what to do when it comes to this. It just doesn't seem to be reading their account and is only applying it to mine.

    I'm still pretty new at this since I've only been struggling my way through it for about 6 months without an education in this field. But I'm definitely looking to learn.

    I have the User Settings menu with 2 dropdowns, one to activate their notepad so that they can see reminders on their dashboard and the other is to change the theme of the forms, and when they select them, it only affects my account and not theirs.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Why are users allowed to change themes? This is design modification.

    How should Access 'know' which user is logged in? Are you saving the user ID to a global variable or to a textbox on a form that stays open for reference? Is a bound form opened to the user's 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.

  3. #3
    Gothyx is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    6
    I would like Access to know which user is logged in. The combobox that is used within the login form is how they gain access, and from that point, the form is just open in the background. But I can't seem to get the user settings to read what account is currently logged in, so it's only applying the settings to the first account on the table, which sadly happens to be mine.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Where should these user settings be 'read' from? Is there a table of users with these parameters? Once user logs in, how are those parameters retrieved? Show code.
    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.

  5. #5
    Gothyx is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    6
    The user table has the two fields, both controlled by comboboxes on the User Settings form. And with me being 19 and not having the education, I'm not entirely sure how to code it TO retrieve those parameters. Should I just attach a copy of the db?

  6. #6
    Gothyx is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    6
    Here's the attached database. The User Settings is found in the System dropdown menu.Matrix Evolution - Copy.zip

    Of course, it's been cut down so it'll fit >.<

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Your code is set for 32-bit system. How do you get it to run without error? Exactly what info do you need to retrieve with the API code? Rather advanced code for a beginner.

    I found System combobox. Where is the code that sets theme?

    Have you step debugged?
    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.

  8. #8
    Gothyx is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    6
    I was wrong when selecting the profiles, I'm on a 32 bit system. Well, the code that sets the theme is within all the forms affected. It uses a lookup to see if the user has the color name in a certain field "ProgramTheme". The problem is, is that after using the dropdown, it's only saving that color name to the first account rather than the one that's logged in. I believe I failed at coding it the proper way to get the results I was hoping. Well, at least it works with 1 account. I had thought I was maybe on the right track. I seem to be lost and not sure about APIs, Modules or Macros, so I'm kind of a sitting duck with issues on the way I'm sure. And I've only been doing this project since July of 2013.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Why do you have the API code? How is it relevant to the login process? What data are you trying to retrieve? If I just delete the API_Registry module will the login still work?

    As for setting 'theme', it appears you are just setting color properties of controls.


    FormOptions is bound to tblUser and is opened unfiltered with the first record active so of course all edits are reflected in that record. Open the form filtered to the logged in user:

    DoCmd.OpenForm "FormOptions", , , "UserID=" & frmLogin!cboUser

    Modify FormOptions RecordSource to include the UserID field.

    SELECT UserID, ProgramTheme FROM tblUser;
    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.

  10. #10
    Gothyx is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    6
    Oh, the API controls the User Setting to change all of Office programs' theme from blue, black or silver. I will give this a try Oh and thank you for the before compliment of the advanced code. I've been trying my best to learn.

    Edit: I had to add "Forms!" to the front of the frmLogin!cboUser and it worked like a dream! Thank you. Now for me to take a wack at the reminder sticky note addon. You taught me something new and crucial today. Thank you

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Ooops, sorry I slipped on the Forms qualifier. Glad you figured it out.
    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.

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

Similar Threads

  1. User controlled program/security settings
    By joelmeaders in forum Database Design
    Replies: 4
    Last Post: 10-09-2012, 09:47 AM
  2. Replies: 0
    Last Post: 10-03-2012, 06:20 AM
  3. Sharepoint List Query Filter based upon User Login
    By Steven.Allman in forum SharePoint
    Replies: 5
    Last Post: 03-22-2012, 11:30 AM
  4. Access Programming issue i think???
    By whitey in forum Programming
    Replies: 3
    Last Post: 01-03-2012, 01:15 PM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 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