473,378 Members | 1,631 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,378 software developers and data experts.

Exporting A Subset of Data From a Table w/o a Query

Hi,

Is there a way to export a subset of data from a table into another Access database without using a query? Preferably some VBA code so the process can easily be repeated. The OutputTo and TransferDatabase methods don't seem to have the option of a Where condition.

The reason I don't want to use a query is because once I define the criteria (i.e. where COUNTRY = "Mozambique") I can no longer use the *. Some of the fields in the table are going to change over time and I don't want folks to have to re-create the query everytime they export (perhaps there is a way around this problem?).

Thanks!
Laura
May 20 '08 #1
6 2977
nico5038
3,080 Expert 2GB
Hi Laura,

You should just use a query with parameters.
When you use in the criteria section e.g.:
[Enter country: ] underneath the Country field, Access will ask for the country when activating the query.

Idea ?

Nic;o)
May 20 '08 #2
Delerna
1,134 Expert 1GB
Yes you can do it with VBA using either DAO or ADO
Can the table you want to export the data to be linked to the database you want to export from? That would greatly simplify the code.
May 21 '08 #3
can't link it, the database I'm exporting into needs to be sent to someone else, i.e. it needs to 'stand alone'...

Yes you can do it with VBA using either DAO or ADO
Can the table you want to export the data to be linked to the database you want to export from? That would greatly simplify the code.
May 21 '08 #4
NeoPa
32,556 Expert Mod 16PB
That's not a good reason that it can't be linked.

As long as the filename (including folder) is the same every time.
May 22 '08 #5
NeoPa
32,556 Expert Mod 16PB
With a link in place, you can create and execute (on the fly) your own SQL code that can be responsive to however you intend that the operator select the desired criteria.
May 22 '08 #6
Delerna
1,134 Expert 1GB
sorry, it slipped my mind that I was going to write some demo code for you.
In light of Neopa's comments.

Will you link it?
It really will be much simpler and besides if not linked, the code will still be referencing a database by name in a particular location, which is what the link does also. The link references a table in a database file at a particular location.
May 22 '08 #7

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

Similar topics

4
by: Angel Cat | last post by:
I'm exporting a large file from a large Production database (SQL). Users are currently updating and inserting new records. Does the export take a snapshot of the data when it starts ? or will...
3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
3
by: Htk | last post by:
I have two access databases. A and B Both have a table with the same name (tbl_data entry) ie. same structure/data. I want to be able to transfer (export) data in this table from database A to...
1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
1
by: Big Time | last post by:
I'm exporting a large amount of data from one of my tables into a tab delimited text file. The problem is the fields that have date format come out in MM/DD/YY HH:MM:SS format when what I want is...
21
by: bobh | last post by:
Hi All, In Access97 I have a table that's greater than 65k records and I'm looking for a VBA way to export the records to Excel. Anyone have vba code to export from access to excel and have the...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
6
by: sara | last post by:
I have what I think is a little strange...I have to get data from our payroll system into a specific format (fixed record length) as a .txt or .prn file only to upload to our 401k custodian. I...
9
by: QCLee | last post by:
Sir can you help me to transfer my Access Query to MS excel? i have a command button on the form to export the parameter query named "HVACWindwardQuery" to excel spreadsheet and i got the codes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.