Results 1 to 3 of 3

Thread: Timed Upload Function with Multiple User Access DB
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Oct 2008
    Location
    New York, NY
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Timed Upload Function with Multiple User Access DB

    I have an MS Access Based DB, which has a dozen or so users. The database is split, each user has an executable .accde front end on their respective desktops. The Back End is on a shared Network drive.

    I've written a function that searches several pre-determined folders for text files, and then uploads the data in those files into the db. It does this on a timer -- every hour during business hours.

    For this to work, I have to choose a user where this function executes. Using a 'getusername' function (getUserName = Environ("USERNAME")), the db determines the windows login id of the user, and I have my upload function kick off only for a specific user.

    I do this because if I don't, the upload will potentially kick off for all dozen users, causing duplication and/or multiple errors.

    The problem is if this user isn't in the office one day, this process will obviously not run.

    Is there a way to determine , at the moment of upload, the windows login of everyone using the db, so then I can choose which user? Or perhaps there's another way to accomplish a data upload on a timer?

  2. #2
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    16,347
    Post Thanks / Like
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Timed Upload Function with Multiple User Access DB

    You can run a scheduled task to run a routine in access.
    See post 6 here:
    https://www.mrexcel.com/forum/micros...cess-code.html

    It might also be wise to allow the program to verify if it has already run and not be able to cause duplicates. As well as have a backup way of kicking this off manually if needed. And even some logging of the event with success or value too.

    Note that many people just have the "automated action" in the open event of an access database (of its own). So then the automated task only needs to open the database and that's all (the database should of course close itself as the last of it's automated actions). It's much the same - probably some pluses and minuses either way depending on preference.
    Last edited by xenou; May 1st, 2019 at 02:11 PM.

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  3. #3
    Board Regular
    Join Date
    Oct 2008
    Location
    New York, NY
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Timed Upload Function with Multiple User Access DB

    This is very helpful. Thanks.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •