Link to home
Start Free TrialLog in
Avatar of M A
M AFlag for United States of America

asked on

Best way to import 2-3 fields data from one table to another

Best way to import daily 2-3 fields data from one table to another linked table in access

We have a database with attendance. I have linked the required table to access. We need to import the data from a query to a linked table in the same access .
Avatar of Daniel Pineault
Daniel Pineault

There are different ways to set this up, but one would be to setup, as part of your startup (autoexec) a routine that check to see if an import was performed that day, and if not, ran the appropriate append/update query and the push the date/time the import was performed.  This way, the 1st person in the system triggers the import automatically, and subsequent user do not.

You can use an INSERT query:


INSERT INTO YourTable(Col1, Col2, Col3, etc) SELECT Col1, Col2, Col3, etc FROM SomeOtherTableOrQuery


Of course, the column datatypes will have to match.



Avatar of M A

ASKER

Thanks for your response.

--> outine that check to see if an import was performed that day, and if not, ran the appropriate append/update query and the push

How do I do that?


@Scott

How to automate this if this works.

You create a table to track when imports, or just the last import, was performed.  Then you use an Insert or Update query to update the value to the current date/time (now()) after you perform an import.  Simply use DLookUp() to check the value prior to performing an import.
SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of M A

ASKER

Attached the access database.

I have both source table and destination table as linked tables. 

I copied the data from both source and destination as a local table.

Source query: GET-CHECK-IN-OUT 

Destination Table: ohrm_attendance_record_local

Related fields Badgenumber(Badgenumber) and employee_id(ohrm_attendance_record_local)

HRMS-temp.accdb

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial