473,657 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automate a Import Process/Maybe just a Refresh

72 New Member
I’d like to try and automate a import process. Below are the steps I currently use to get these excel spread sheets into my ms access database.

Manual delete tables Table1, Table2, Table3, Table4.
Open the macro to TransferSpreads heet exel TableA
Open the macro to TransferSpreads heet exel TableB
Open the macro to TransferSpreads heet exel TableC
Open the macro to TransferSpreads heet exel TableD

“All these tables have the same type of data, and field names”

Run append query to Master_Append_q ty for all 4 Tables.

Is there a way I can just do a refresh. All

Can I get some advice or help automating this process

Thanks for all your help and time
TCB
Dec 28 '10 #1
1 1485
Lysander
344 Recognized Expert Contributor
You could put a button on your form, and use the On_click event to write VBA code something like this.

Expand|Select|Wrap|Line Numbers
  1. db.Execute ("DROP TABLE Table1;"), dbFailOnError
  2. db.Execute ("DROP TABLE Table2;"), dbFailOnError
  3. 'etc for all tables
  4. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel7, "Table1", "C:\Myspreadsheet1", True
  5.  
  6. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel7, "Table2", "C:\Myspreadsheet2", True
  7.  
  8. etc
  9.  
Dec 29 '10 #2

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

Similar topics

11
1625
by: Ville Vainio | last post by:
It might just be that @decorator might not be all that bad. When you look at code that uses it it's not that ugly after all. A lot of the furor about this is probably because it happened so quicly. The situation might have been different if we had seen a pronouncement a week before, in the vein of "I have chosen this syntax - it will go in to the next alpha". My chief worry was throwing away one of the few unused ascii symbols, but if...
3
2237
by: meyvn77 | last post by:
Hello, I have a monthly dump that comes to us in access format. That dump needs to be imported into sql server(Fromt end ADP) as part of the monthly update routine. The process should go something like this: 1) ADP form opens up 2) click the update button 3) locate the .MDB 4) *VBA Code in the ADP imports the tables
2
2709
by: Phil Latio | last post by:
We have despatch process which kicks out picking information into text files at hourly intervals. The text files are named sequentially by process; 'ABC.txt', 'ABC01.txt', 'ABC02.txt' for one process, or 'XYZ.txt', 'XYZ01.txt' for another process. The folder contents would look like this; ABC.txt ABC01.txt
0
1373
by: Jill Elaine | last post by:
I want to automate the import of 5 encrypted .db (Paradox) tables into a MS Access 2002 database every time the Access database is opened. I think I could use the TransferDatabase method to import the .db tables, but, since these tables are encrypted, I need to provide a password at the start of the import. Unfortunately, the .db tables are created as part of an application: I cannot unencrypt the tables nor set the password to...
16
4542
by: LP | last post by:
Hello, I am trying to use .NET with Excel. I installed Office 2003 and selected ..NET programming suport option, so it installed all those PIA, as MS sugests. But I can not find a way to destroy Excel process, it still hangs in the taks manager' Processes as running. I am trying very simple code (see below), but Excel wont go away, I tried just about anything I could find on MSDN or by Google. Even calling WIN32 API to destroy Excel. But...
6
998
by: Sam Malone | last post by:
Am I just totally missing something here? I'm just new to VS.NET 2005 (using VB.NET) and ADO.NET. I get the impression that ADO.NET can't do what I'm used to doing with ADO (previous ADO withVB6). I used to bind (let's say a text box) to a field (column) in a recordset and if I typed a value in that textbox and tabbed out of it, the value in the database got updated without me having to do anything else. Now what I see is a terribly...
3
1941
by: Simon | last post by:
Dear reader, One table in database A...mdb is linked to a table in database B..mdb. As A..mdb is open and in B...mdb starts an excel import procedure the progress bar shows that the import procedure stops. After the A...mdb is closed the excel import procedure runs smoothly. The linked table in A..mdb is not the same table as used for the excel import procedure. Is there
1
2228
by: jgscott3 | last post by:
Dear Access Developers: I need to automatically import a file into Access from the same directory every day. However, I need the code to search the files in the directory and only import the one with the current day's date in the file name (otherwise, the file name will not change). Alternatively, Access could just import the one with the most recent save date. Can anyone provide code to do this?
4
1191
by: Cirene | last post by:
i am creating an asp.net auction website how do i create a process that will "end" the auction when it's time obviously i don't want to sit at a browser and keep refreshing the page i'm not sure if i can install an application on the server too (not allowed?) thanks...
5
11801
by: NarayanaR | last post by:
Hello, I'm new to Office(!) but not to programming. I have a requirement that I'm struggling to solve: 1. In Access, I import a List from a sharepoint site as a linked table. 2. I delete all the data in the list. 3. I import an Excel file from my local system onto this linked table. 4. Save and close. How can I automate this?
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.