exporting multiple tables

Hi,
I have 6 tables in my database.
Depending on which tables the user choses, I want to be able to export those.
So if the user picks 4 tables to export, I want to be able to export 4 
different text files.  
Please help.  
Thank you.
0
Utf
4/26/2010 1:44:01 AM
access.modulesdaovba 1670 articles. 0 followers. Follow

2 Replies
633 Views

Similar Articles

[PageSpeed] 40

Angela wrote:
>Hi,
>I have 6 tables in my database.
>Depending on which tables the user choses, I want to be able to export those.
>So if the user picks 4 tables to export, I want to be able to export 4 
>different text files.  
>Please help.  
>Thank you.

How does the user choose the tables?  If you use a multi-select listbox, you
can loop through the ItemsSelected collection and export them.

dim varItem as variant
for each varItem in me.lbxItemList.ItemsSelected
     docmd.TransferText .... varItem  ... blah blah blah
next varItem

transferText exports each object selected to a different file...

-- 
Message posted via http://www.accessmonster.com

0
PieterLinden
4/26/2010 2:49:20 AM
Sub Exporting()

    Dim obj As AccessObject, dbs As Object
    
    Set dbs = Application.CurrentData
    
    ' Check each object of the AllTables collection
    For Each obj In dbs.AllTables
        DoCmd.OutputTo acOutputTable, obj.Name, "MS-DOSText(*.txt)", "", 
False, "", 0, acExportQualityPrint
    Next obj
End Sub

-- 
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"PieterLinden via AccessMonster.com" wrote:

> Angela wrote:
> >Hi,
> >I have 6 tables in my database.
> >Depending on which tables the user choses, I want to be able to export those.
> >So if the user picks 4 tables to export, I want to be able to export 4 
> >different text files.  
> >Please help.  
> >Thank you.
> 
> How does the user choose the tables?  If you use a multi-select listbox, you
> can loop through the ItemsSelected collection and export them.
> 
> dim varItem as variant
> for each varItem in me.lbxItemList.ItemsSelected
>      docmd.TransferText .... varItem  ... blah blah blah
> next varItem
> 
> transferText exports each object selected to a different file...
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> .
> 
0
Utf
4/26/2010 4:24:01 AM
Reply:

Similar Artilces:

Mails are being send without colors and table structure destroyed
Dear All, I am using Microsoft Outlook 2003. My other office products are of Office 2000. Word 2003 is not there on my PC and therefore the option to use it is disabled. Now how to use Microsoft Word 2000 as the mail editor? I am facing some strange problems with Outlook 2003. I composed a outage notice in Word 200 with table structure and colouring. I pasted the same in mail and send it. The mail send was in a format where table structure completely destroyed, all the words are not well aligned and the e-mail is not in colors. I able to see it structured in the send folder but it is not gett...

If Statement and Multiple Criteria
I am using a formula to bring back some text about some data. I am using the following formula: =IF(N12>M12,"is larger for girls","is larger for boys"), so that if the data in cell N12 is greater than the data in cell M12 then it says "is larger for girls" and vice versa. This works fine, apart from if negative numbers are in the cells then it brings back the value closest to zero - rather than the largest negative number. Does anyone know how to get round this. In addition - I would ideally like to alter the formula so that it says that if the two...

OT: demoralized tables
Kirk Kuykendall has a good overview on Common Table Expressions http://www.sqlservercentral.com/articles/CTE/62291/ but his conclusion contains a "new db term" (at least I had never seen it before)... "As you can see CTEs can be very useful. I have found them particularly handy when cleaning up demoralized tables. Like imported spread sheets." I assume it was on purpose and couldn't resist passing it on. We've all been there... gary I'm wondering if demoralized tables might be an undiscovered cause of file corruption. I would think that one table wit...

How to change multiple folders views in Outlook
When you first create an account within Outlook (currently using 2007 but I'm sure it's the same for other versions) it defaults the folders so that certain columns are visable they all have the viewing pane enabled. Is there a way of changing one folder so that all folders look identicle (Deleted, Drafts, Inbox, Junk E-Mail, Outbox etc etc etc). I'm sure there must be a way but I'd be damned if I can find it...and it's driving me nuts!! Cheers Glenn gloriousglenn@hotmail.com <gloriousglenn@hotmail.com> wrote: > Is there a way of changing one folder so that a...

find data in multiple open workbooks
Im looking to find data in multiple workbooks that are all opened at once. Is there a way of doing this? ...

Export from Access
I built an Access database which to export the daliy (new) figures to Excel to the desktop. One of the queries is for pulling all the information for a Credit Manager (CM). I then need to link this data to a summary spreadsheet. So each day I want to go to my database, pick the CM's data, export and replace the old info with the new, and keep the links I have created when I exported the first one. When I exported the first, I linked it to a number of spreadsheets. Any thoughts? I get an error telling me that It cannot expand the named range. If I rename it then I would have to r...

Export a range to a text file
Hello need some advise on how to procede I need to be able to create a text file containg some text as well as data that is within a named range in excel and then some more text. I can handle printing to the text files using cell values etc but am unsure of the best way to print the ranges data. Is there a way or procedure to just print the range as is in csv format? As well my range will contain about 6 columns, each containg a number field (formatting of decimal places is important, some have 2 dec some 3 etc) Also the range has a max of 50 rows however will always contain lower rows of...

9.0 Table Changes
Will be updating to V9, am looking for a list of the tables that changed and the documentation says it is on V9 cd 2, under the SDK But I don't see anything on the CD so do I have to install v9, and the SDK before I can get a list of the table names? -- Doug You need to install the SDK "Doug" wrote: > Will be updating to V9, am looking for a list of the tables that changed and > the documentation says it is on V9 cd 2, under the SDK > > But I don't see anything on the CD so do I have to install v9, and the SDK > before I can get a list of the tabl...

Vlookup based on multiple criteria
I have 2 workbooks: Workbook one: Account number, name, January to September + total (columns A9 to L240) Workbook two: I need to populate with data from Workbook one Column A has the account numbers all accounts that contains department 71(xxxxx-71-xx) must go to location 1 (Jan - column B, Feb =96 column E etc) and all others goes to location 4 (Jan =96 column C, Feb =96 column F etc) Is there a basic a VLOOKUP or other function that can automatic the tasks? Thanks in advance. Workbook one Account Number Jan-10 Feb-10 Mar-10 41001-71-01 6,000.00 - 1,000.00 41001-71...

Import/Export addresses
I have contacts in Outlook 2003 that I would like to export to Outlook express and need some help on the best way to do this. Thanks "Richard Mahan" <dmachen35@comcast.net> wrote in message news:v-idnQYiANC_CFLZnZ2dnUVZ_qqdnZ2d@comcast.com... >I have contacts in Outlook 2003 that I would like to export to Outlook >express and need some help on the best way to do this. Thanks > In Outlook, export Contacts as csv file. In Outlook Express, Import-Other address book-Text file csv. HTH ...

counting using multiple criteria
Hi, I have a problem for which I can't seem to find a working solution. On the one hand I have a vertical table with employee names, the number of years they have been with the company, and all this sorted by the employee's age (in years). This table will be updated from time to time, and as such it doesn't have a fixed length. On the other hand I have a table which shows the number of employees in a particular age category (-20, 21-25, 26-30, etc) horizontally, and the number of years they have been with the company (again in groups: 0-5 yrs, 5-10 yrs, etc) vertically. ...

Formatting multiple object types in output from a function?
I'm stumped on this one, and have searched and searched for a solution or how-to with no luck. Perhaps it just can't be done. I have a function that may or may not return objects of multiple types. I've setup the type and formatting information for each of the individual types in format.ps1xml files, and when only 1 type is returned by the function the formatting works as I would expect. However, if two or more types are returned by the function, only the formatting for the first object type is applied and then the other types are displayed however PoSH deems ap...

Scrolling Tables list
When I use the scroll bar to move up and down the list of tables or queries etc, the list continues to vacillate after I stop sliding the bar; making it difficult to find the item I want to select. This seems to be worse with my new computer. Are there settings I should adjust. "Crop scout" <Crop scout@discussions.microsoft.com> kirjoitti viestiss´┐Ż:771C65DD-5D6E-47EF-B987-C797A680FB59@microsoft.com... > When I use the scroll bar to move up and down the list of tables or > queries > etc, the list continues to vacillate after I stop sliding the bar; makin...

Adding Fields and Tables to MSCRM
Is there a link or some reference on the ability to add fields to existing tables in the CRM database and/or adding complete tables to the CRM database?? I am asking this from the point of view relating to other existing CRM products (saleslogix, frontrange - shh). From what I have played with so far from playing with my SBS2k/MSCRM install is I my need to have a MS developer skillset. Robb, Using the schema manager in the deployment Manager MMC snap-in, you can add fields to the existing tables. However, there is no way to add new tables. Matt "Robb D" <robbd@eproductscons...

Is it possible to find multiple data?
We have a small lotterysyndicate in work which is all logged onto an excel spreadsheet. Is it possible to search all numbers and all occurances at once, rather than individually? Ie - we have 15 lines of 6 numbers each - can i search for all 6 numbers drawn, across all 15 lines in one go? Im sure this must be possible - just dont know how. Thanks -- stewwie ------------------------------------------------------------------------ stewwie's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=37128 View this thread: http://www.excelforum.com/showthread.php?threadid...

Saving data in Access table with VB ?
I have a form with a button and if you click the button, a list of invoices are generated and saved in the table 'Invoice'. Problem is, the data isnt saved :( Here's my code: Private Sub Knop0_Click() Dim Invoicenr As Long Dim Invoicedate As Date stdocname = "Invoice" DoCmd.OpenTable stdocname, acViewNormal, acAd Invoicenr = 111111 Invoicedate = Now DoCmd.Save acTable, stdocname End Sub What am I doing wrong ? Answered in microsoft.public.access "Bauhaus" <niemandhier@pandora.be> wrote in message news:7Exii.2418$yf6.1885@biebel.telenet-ops.be...

Pivot Table and adding a % column, that is not in original data
Hi, Is it possible to add a column for % calculations when the % column is not in original data? To clarify, my original data is as follows: Produt Sales Returns Date A 5 June B 6 June A 1 July A 1 September B 1 November When I run the pivot table, one of the columns I'm then looking to get is a total % of returns over sales , but I cant see how to include in a Pivot table. I can add it outside of the table, but that has problems ...

multiple entries in outlook 2003
i have one user who has mulitple entries of users showing in his contacts window. I am not talking double entries (one must be a business fax), but more like 8 or 9 entries all the same. I exported his contacts to a csv file to see if they have slight differences but no they seem to be exactly the same. So far hea is deleting old ones, but they keep coming back. Now for the fun bit. It is not all users multiplying, just about 50% of them. it seems to happen every time he logs on he gets another replication. He also has the issue that if he creates a new contact in his contacts window it...

Table-like Outline and Collumm that sums prevous values up
Hello The report I would like to have should be in a tabular form just like the doc document I have attached. However, until now I have not found out how to set the report into a tabular outline. It is quite uncomfortable and time intensive to set up this report by using lines and the different text fields. In addition, it will not look any good at the end.. Also, I would need a columm that is able to sum up the values before. Just like the "total" under each semester. Are the issues solvable? Greets, Hubertholz attached: http://rapidshare.com/files/35708241...

How can I compare the column names from 2 tables and output them?
I have a requirement to place an alert if the field does not exist in my table, tblStaging. Can any one guide me to reframe this query with error handling messages? I know it is not good practice to use select * but I need to do this as my columns\field names change each time. INSERT INTO tblStaging SELECT * FROM tbl_XL,tblDetails; Thank you -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1 Access is a relational database. If your "table design" has the fields in your table(s) changing frequently,...

Changing multiple appointment times
I have hundreds of appointments and would like to move them back one hour. I know there is a link in microsofts support site that lets you change the time zone without changing appointment times. However, recurring appointments are not supported by that method. Does anyone know of a way to move all my appointments back one hour? ...

Managing Calender's across Multiple Accounts
The CEO of my organization is actually the CEO of several companies, and as such, required several separate e-mail addresses(3). He also travels a lot and makes use of his Aircard to access the company network remotely with his laptop. So, I created an outlook profile for him on his laptop with all 3 Exchange accounts attached to it (on the same profile), but the network traffic was too much for the aircard to handle. So, I seperated them into 3 seperate Outlook profiles, and he needs to choose which to connect to when he logs in. This seems to work out well for him for the most part, wh...

Multiple Calendars
I have created multiple calendars for my boss, for different program components. He has the need to print these calendars frequently, but finds it extremely frustrating to have to change the header for each calendar he prints. I must say it seems obvious to me that there should be a way to have separate headers for each calendar, obviating the need to change the header for each different calendar printed. Another issue is the impossibility of emailing the calendars. We do not have ready access to a web server and I have not been able to save as html without a webserver. I tried e...

Exporting a Report to Excel
I have a program that allows the user to select a report from a drop down that is followed by a filter option window that I have used and it works great. However this new project requires that each of the reports have the option to be exported to excel. In the past I have used the following code with just the first two Cases. stDocName is the name of the report set by the dropdown and sFilter is the requested filter built by the users selections. My problem is Case 3! This will do just what I want accept I can not pass it the filter, so all the records are moved, not the filte...

Table-lookup transformations
Hi, we are doing some table-lookup transformations based on LEFT and INNER joins. Probably around 100 - 50K rows/second or something like that. I have noticed that the lookups are getting slower and slower due to a growing database. The server itself is heavily loaded, CPU and IO-subsystem - which I know is not a good combination with SQL server :| I am looking for a way to increase the table-lookup transformation speed without mixing up things with SSIS.. Are there any good ways of doing table-lookup transformations within SQL server? Would it be a good idea to write s...