Import Spreadsheet with form variables

Larnu

Registered User.
Local time
Today, 05:31
Joined
Oct 18, 2012
Messages
32
Hi all,

I'm looking at importing data into a table from a spreadsheet. The spreadsheet will only contain a single column of data, while the table in Access will have a few more, some of which will would be will provided from the form the user is using to import the data, and some at a later date.

Is there a way to do this? I've found the "DoCmd.TransferSpreadsheet acImport" command, but not sure this fulfills what I need, as I can't see a way to set variable data.

Here is a brief idea of what my Table would look like, where where the data to import would be obtained from

Fields:
PromoID, DiscountID, PromoCode, AddedBy, DateAdded, UsedBy, DateUsed

Spreadsheet
PromoCode

Form:
DiscountID, AddedBy (environ("username") query), Date ( DATE() )

Note, the PromoID is a autonumber.

Hope that all makes sense, but please ask if anything I've said that doesn't.

Thanks for any help you can provide.

Kind regards,

Thomas
 
Last edited:
On way to do it is, first import the whole sheet into MS-Access in a temporary table, then afterwards run an append query, included the AddedBy and DateAdded, to append the data to your (final) table.
 
Thanks JHB. I was hoping for something a little "cleaner" but it does the job.

Cheers.
 

Users who are viewing this thread

Back
Top Bottom