Timed Upload Function with Multiple User Access DB

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
126
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?
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,629
Office Version
2013
Platform
Windows
You can run a scheduled task to run a routine in access.
See post 6 here:
https://www.mrexcel.com/forum/microsoft-access/764991-auto-trigger-ms-access-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:

Watch MrExcel Video

Forum statistics

Threads
1,096,144
Messages
5,448,592
Members
405,522
Latest member
NomanAziz

This Week's Hot Topics

Top