473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Auto-linking in Access is it possible?

navyguy59
I need to know if I make an Access database that utilizes the Get External Data function to draw data from multiple Excel documents, can I do something to auto-update the database to accept new excel documents saved into the target folder and incorporate them into the database or do I have to enter each new document manually? The excel documents I plan to link into the database are monthly reports with a new excel document added to the folder every month. Is there anything I can do to accomplish this?
Sep 6 '07 #1
4 1817
JConsulting
603 Expert 512MB
I need to know if I make an Access database that utilizes the Get External Data function to draw data from multiple Excel documents, can I do something to auto-update the database to accept new excel documents saved into the target folder and incorporate them into the database or do I have to enter each new document manually? The excel documents I plan to link into the database are monthly reports with a new excel document added to the folder every month. Is there anything I can do to accomplish this?

Is the layout of the spreadsheets always the same? Same columns and datatypes?

Do you wish to put everything into the same table each time?

What do you wish to do once a spreadsheet has been uploaded? Will you move it or rename it so it doesn't get imported twice?

will there be duplicate data from spreadsheet to spreadsheet?
Sep 7 '07 #2
Is the layout of the spreadsheets always the same? Yes it the same layout just with new figures added to reflect fule amounts and time flying used for the month.
Same columns and datatypes? Yes

Do you wish to put everything into the same table each time? I want to be able to track 12 months worth of data on fuel used and time in flight basically. I will manipulate this data in various ways to be sure but on that note I am waiting for the Maint Officer to clarify what all he needs done with the information. The data will comprise of 12 excel documents one generated each month and placed into a shared drive where we can access them. They will come out with a new one each month.
What do you wish to do once a spreadsheet has been uploaded? The Officer I am working on this project for has not yet decided what all he needs this database to be able to do with the data. Until he can clarify that part for me I am just trying to get an outline of what I can do.
Will you move it or rename it so it doesn't get imported twice? The database or the excel files? Database should stay in the network folder I create it in, I do not forsee the files name changing. The excel documents will be named by month and year...Example: Jan07.xls
Will there be duplicate data from spreadsheet to spreadsheet?
Duplicate data will be rare as the fuel quantities from month to month and flight times are always changing as we fly at the needs of the Navy not at a set schedule.
Sep 7 '07 #3
JConsulting
603 Expert 512MB
Duplicate data will be rare as the fuel quantities from month to month and flight times are always changing as we fly at the needs of the Navy not at a set schedule.

Take a look through this function. It uses a table that stores the path to the spreadsheets and loops through the directory importing the files one after another. It may be a bit much for what you're after, considering you'll have one per month, but the method is still valid.

Expand|Select|Wrap|Line Numbers
  1. Public Function LoopThroughPath()
  2. Dim strPath As String
  3. Dim strFile As String
  4. Dim myFullFile As String
  5. Dim ImportTable As String
  6. Dim strDest As String
  7. ImportTable = "MyImportTable"
  8. 'Clear old records out of the Import Table
  9. CurrentDb.Execute "Delete * from " & ImportTable & ";"
  10. strPath = "C:\Test\"   ' Set the path for the Source Directory.
  11. strDest = "C:\Test\Imported\" ' Set the path for the Save Directory.
  12. strFile = Dir(strPath, vbDirectory) 'Don't change this part
  13. Do While strFile <> ""
  14.     If Right(strFile, 4) = ".xls" Then ' Criteria, ie File Extension
  15.         myFullFile = strPath & strFile
  16.         'Import data to the Import table
  17.         DoCmd.TransferSpreadsheet acImport, 8, strTable, myFullFile, True, ""
  18.         'Now I want to move the selected excel file to the "done" directory
  19.         FileCopy myFullFile, strDest & strFile
  20.         Kill myFullFile  'Delete the spreadsheet from the Source Directory
  21.     End If
  22.     strFile = Dir()
  23. Loop
  24. End Function
  25.  
J
Sep 8 '07 #4
Wayne L
31
Can this code be used to import .dbf files also? I am trying to import only the new .dbf files that are generated. The file all start the same but increment in numbers.
Sep 24 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Manlio Perillo | last post by:
Hi. This post follows "does python have useless destructors". I'm not an expert, so I hope what I will write is meaningfull and clear. Actually in Python there is no possibility to write code...
1
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like...
1
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
20
by: Vijay Kumar R. Zanvar | last post by:
Hello, Unlike register, auto keyword can not be used to declare formal parameter(s). Is there any specific reason for this? Kind regards, Vijay Kumar R. Zanvar
5
by: Samuel | last post by:
Hi, I am running into a problem of mixing UICulture = auto and allowing users to select culture using a dropdown list. I am detecting a querystring, "setlang", and when found, setting the...
5
by: maya | last post by:
at work they decided to center divs thus: body {text-align:center} #content {width: 612px; text-align:left; margin: 0 auto 0 auto; } this works fine in IE & FF, EXCEPT in FF it doesn't work if...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
22
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
2
by: Piotr K | last post by:
Hi, I've encountered a strange problem with Firefox which I don't have any idea how to resolve. To the point: I've <divelement with a style "height: auto" and I want to retrieve this value...
21
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.