Results 1 to 10 of 10
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    Separate store's managers to only see their store's data

    What's up guys,



    I have "Reporting" program that is store on our server. All of our 8 store's managers have access to this program. None of them are very good with computers. Currently, the manager will type in a date range and store number and press the desired report button. The sales manager has recently found out that any manager can see any other store's reports. These reports include certain confidential data such as pay, bonuses, performance, etc.

    What I would like is as follows:

    At the main switchboard, you click the "Reporting" program button. A password modal pops up (no username). This password tells the program what store number to use in all of the report options.

    What is the best way to accomplish this? I figured I would need to have a table with a list of passwords and store numbers. I just don't know how to actually get that store number to be used in the reports without that password having to be typed in every time (like a parameter).

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    One way would be a DLookup() to make sure it was a valid password and to find the associated store. Put the store number in a hidden textbox on the main switchboard (or wherever) and have the report queries use that textbox in their criteria.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Ah that could work.

    One other question. I would like to have a master password. If used maybe it unhides that textbox so the user could type in whichever store they want; or something similar. How could I do that?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You could make the store number for that password "Master" or 77777 (or whatever, depending on whether your field is text or numeric) and test for the result of the DLookup() equaling that. If it is, unhide the textbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Nice! That should work great. I'll post if I have any issues. I appreciate the help!

  6. #6
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Is this the best way to do this:

    I have 2 forms: F_Password and F_Reports
    F_Password is a small form with a text box, log in button, and cancel button. Modal is set to yes. The code attached to the log in button has the dlookup (which works great, thanks again) and a docmd to open F_Reports. The dlookup stores the result as StoreValue which globally declared (I think that is what it is called... its at the top of the code, before any of the subs).

    In the On Load event for F_Reports, I was going to have a Select case for the StoreValue string. The outcome of the cases would be to set the store value as the hidden text box, or to unhide the text box.

    Should that work? Is there a better way?

  7. #7
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    I'm stuck. I can't get StoreValue to get read by F_Reports.

    Also, what's the easiest way to make it so after typing a password, pressing Enter does the same thing as clicking the Log In button?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can use the after update event of the textbox to avoid having to click on a button. As to the variable, it shouldn't be in the form module, it should be in a standard module and declared like:

    Public VariableName As DataType
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Figured the module issue out a few minutes ago, then just hit F5 on here. I ended up using openargs on the docmd.openform and everything is working like a charm! I really appreciate all of the help!

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 12-02-2012, 09:14 PM
  2. Replies: 3
    Last Post: 11-29-2012, 11:00 AM
  3. How to store ID on list box but show related data
    By Clarionchanger in forum Access
    Replies: 3
    Last Post: 10-11-2012, 03:31 PM
  4. How to store data many row in one table
    By dododo in forum Access
    Replies: 4
    Last Post: 06-25-2011, 12:42 AM
  5. Store data in Excel automatically is that possible
    By drumaster in forum Import/Export Data
    Replies: 2
    Last Post: 04-27-2011, 03:28 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