Results 1 to 3 of 3
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    QueryDef

    I think I need to use QueryDef to create a temporary query, but I don't understand how to do it.



    I have a table which currently contains 4 fields: ID, Name, RailC, RaidG. Their are about 10000 rows in this table. I have a query that lists them in ascending order by the name, and the query exports only the name, RailC, and RailG to an excel file.

    The user is able to add addtional fields. As an example, RailF. I've written code so that RailF is inserted between RailC and RailG.

    So my problem is when I need to export to excel, how do I get the additional field within my query.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,923
    No QueryDef needed. Try:

    SELECT [Name], RailC, Null As RailF, RailG FROM table;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks. That worked

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Can someone explain querydef?
    By roguex20 in forum Access
    Replies: 2
    Last Post: 07-22-2012, 11:57 AM
  2. Exporting to Excel with Automation using QueryDef
    By Niezels in forum Import/Export Data
    Replies: 3
    Last Post: 09-26-2010, 05:55 PM
  3. Adding Totals to a query using queryDef
    By jrickels in forum Programming
    Replies: 7
    Last Post: 04-06-2010, 07:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums