+ Reply to Thread
Results 1 to 6 of 6

Export the Query Itself? Not The Data!

  1. #1
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Export the Query Itself? Not The Data!

    Is it possible to export the query itself, not the data generated from the query?

    This is the 1st time I've looked at Access and I'm trying to figure out a systematical way of working with data generated from Excel.
    Ideally I'd have several Access tables and simply import the query into each of them and run it, but if it's only possible to generate a query from design in each database this will be quite long winded.
    Last edited by Dal123; 02-13-2018 at 08:39 AM.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,173

    Re: Export the Query Itself? Not The Data!

    yes
    vb:
    docmd.TransferDatabase acExport ,"Microsoft Access","c:\folder\dbname.mdb",acQuery ,"qsMyQuery","qsMyQuery"

    in macro:
    ImportExportData...etc

  3. #3
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: Export the Query Itself? Not The Data!

    Thanks ranman256,

    When I try to run the module it asks me to pick macro name, the macro isn't available to select.
    The macro has been saved and named as ExportQuery.

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Export the Query Itself? Not The Data!

    Please Login or Register  to view this content.
    Needs to be set up with an identification as above
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    274

    Re: Export the Query Itself? Not The Data!

    I started coding an export VBA a while back that I got working to suit my needs, and left in the ToDo's incase I needed to expand it later


    it uses a table in the ms-access database to tell it what needs exported


    ~TablesToExportSQL
    File TableName ObjectType ExportOrder
    Short Text(255) Short Text(255) Short Text(5) Number(Long Integer)
    OutFile1.sql Object Name 'Table', 'Query', 'Form', 'VBA', 'Macro' 1,2,3,4,...


    Note: use find and replace on é to E in the following code.
    Please Login or Register  to view this content.
    If it'd make you feel better using my answer because of my street cred, then you can go ahead and click Add Reputation below to improve it.

  6. #6
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: Export the Query Itself? Not The Data!

    Thanks for the great input people, much appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Export to pdf - filename query
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-24-2014, 01:01 PM
  2. Impoert from web Query downloadable export
    By cladkins in forum Excel General
    Replies: 0
    Last Post: 04-12-2013, 01:12 AM
  3. Replies: 3
    Last Post: 01-11-2013, 08:08 AM
  4. Custom Report Query & Export
    By gdubf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2009, 09:52 AM
  5. [SOLVED] how to export data into query
    By tires85 in forum Excel General
    Replies: 2
    Last Post: 08-14-2006, 08:55 AM
  6. How do I export dates into a query?
    By tires85 in forum Excel General
    Replies: 0
    Last Post: 08-11-2006, 04:20 PM
  7. [SOLVED] How do I get my dates in a report to export into my query?
    By tires85 in forum Excel General
    Replies: 0
    Last Post: 08-11-2006, 11:10 AM
  8. [SOLVED] Micosoft Query does not export result set to excel
    By Peter McAuley in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1