Solved Using Raw Date and Time as Primary Key (1 Viewer)

regnewby2465

Member
Local time
Today, 01:35
Joined
Sep 22, 2015
Messages
58
I am very green at VBA and designing Macros so hopefully this can be done without either.... but if not, I can certainly give it a try. I have created database in Access 2013 that is intended to be used to record the employee's activity for the shift. Each employee has their own laptop and on each laptop, I have a front end and back end database. Front end is called WPDTables with a number of tables therein that are linked to WPDCAD database as the front end. The employee enters data while in the field. Just as a side note, each laptop does have connectivity through verizon.

My goal is to design a method either programmaticaly or manually where employees' data can be compiled together so that I can run reports from one "master" source than separate individual sources. If I was doing this in a network environment then I would have employees access the "master" back end db accessed through the the LAN and therefor eliminating the need for each employee to have a back end on their laptop. Unfortunately, the employees do their data entry outside of the network in the field.

I have played around with putting each laptop's back end in One-Drive but as you can imagine, syncing is a nightmare. I have pretty much abandoned that route.

My next thought would be to design a method to programmaticaly or manually append the data that is on each separate back end into one "master" back end in the office. I am believing that to do this, the primary keys in each separate back end would have to be unique to the laptop. If not, when I would try to append, a primary key that was once unique on its own laptop is no long unique in the master.

Does any one have suggestions? I think I can pull this off if someone can help me with a macro or VBA that will create a custom primary key that would be unique to the laptop. Perhaps a combination of the employee's ID and autonumber? Or since there would only be one or two employees working at one time, is there anyway to use the Now() as a primary key without any formatting? Thanks for any help.
 

spikepl

Eledittingent Beliped
Local time
Today, 07:35
Joined
Nov 3, 2010
Messages
6,142
Don't invent weird things.

For field use, you can have a normal db, with autonumbers as PK. When consolidating data in central db, the PKs just need to be copied/made into composite PK's, where the second part is some constant, unique per machine or user. All this assuming one way data flow.

Update: composite in this instance is "consisting of two numbers"
 
Last edited:

regnewby2465

Member
Local time
Today, 01:35
Joined
Sep 22, 2015
Messages
58
Thank you for the quick response. I was thinking that the date/time without any formatting might be okay since it would be highly unlikely that one of only two employees on duty at a time would update a record at the very same second.

I will do some reading on how to make a composite PK. Unfortunately, every day when the employee goes on duty, he or she will have to update their own laptop with the latest data that has been compiled from the Master db. I know this may complicate things greatly.
 

Users who are viewing this thread

Top Bottom