Thanks for the help!
The name of the table that the data will be stored in is called
ExpenseClaimTable. It will be stored in the D drive in the Dawn folder.
The name of each fields that I want referenced from this table are:
? don't know if I need an itinerary number to pull up the specific record,
if not, there is no use for this field here.
First sheet: "GC74 - PLEASE COMPLETE FIRST"
* Departure Date [FieldCallItinerary] A9
* Departure Time [FieldCallItinerary] B9
* Distance travelled [ExpenseClaimTable] G9
* Parking expenses [ExpenseClaimTable] Q9
* Other (travel) [ExpenseClaimTable] T9
* breakfast [ExpenseClaimTable] I9
* lunch [ExpenseClaimTable] J9
* dinner [FieldCallItinerary] K9
* other (meal) [ExpenseClaimTable] L9
* registration fee this is added to the "Other misc" [ExpenseClaimTable] L9
* other (misc) [ExpenseClaimTable] L9 [ANYTHING EXTRA GOES IN L9]
* First name, Last name (these are in separate field but need together here)
[Officers] D4
Second sheet: some data will autofill from the page above "Travel Claim"
* Name (auto from above)
* PRI [Officers] E5
* Work Phone [Officers] E7
* StreetAddress [Officers] E8
* City [Officers] E9
* Province [Officers] E10
* Postal Code (need province and postal code to appear on same line)
[Officers]
* Bank [Officers] i7
* Home [Officers] I9
* Time leave am (H14) or PM (h15) (this isn't set up in my database but it
is on the form
* Time return AM (H16) or PM (H17) (this isn't set up on my database but it
is on the form
* Notes [FieldCallItinerary] E20
* City (this is the destination) [FieldCallItinerary] E21
* km travelled (should copy from cell above) G30
* breakfast (should copy from cell above) G35
* lunch (should copy from cell above) G36
* dinner (should copy from above) G37
* Other (misc) (should copy from above) G38
The path to the excel file is D drive, Dawn folder, ExpenseClaims subfolder.
I'm not sure about the last question so I will just put the cell number of
the excel spreadsheet that it is supposed to go to..
Sorry, tried to be as organized as possible..
Cheers!
Beetle said:
Can I just copy that somewhere into my access program and then
adjust the variables?
To a certain extent, yes. The first thing you would want to do is open
a code window and go to Tools/References and make sure you have a
reference set to the Microsoft Excel Object Library.
Next you would need to modify the SQL statement to pull the appropriate
fields from whichever table you want. You would also need to modify the
recorset field names.
Last, you would need to put in the path to your Excel file and set the
appropriate row and column number where you want the data input
to start.
If you need help post back. If you do post back for help, make sure to include
the following;
The name of the table the data is stored in
The name of each field in that table that you want to reference
The name of the path to your Excel file
The cell (A3, B4, whatever) in the Excel file where you want the data transfer
to start
--