Results 1 to 9 of 9
  1. #1
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63

    Export Data


    I am trying to export data from my database into an excel file. The problem I am having is that fields represented in access with an autoid are showing up in the excel as the autoid and not the corresponding name associated with the autoid. Is there any way to get around this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    You mean the autoid that has been saved as a foreign key in another table? You are exporting from that second table? Export records from query that joins the two tables. That will make all fields from the related tables available.
    Last edited by June7; 03-05-2012 at 10:57 PM.
    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
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63
    I'm exporting from the query that joins the two tables and they are joined by a relationship. I get the actual names when I run the query by the autoid when I export the data.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What method are you using for the export?

    If you include the name field from the associated table in the query, it should export. Show the query SQL statement for analysis.
    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.

  5. #5
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63
    Below is the query I have made

    SELECT qry_Info_Pt.MRN, qry_Info_Pt.LastName, qry_Info_Pt.FirstName, tbl_Referral.DischargeHosp, tbl_Referral.AdmitFacility, tbl_Referral.Date, tbl_Referral.Insurance, tbl_Referral.Comments, qry_Info_Pt.Name, tbl_Referral.ReferralID
    FROM tbl_Info_Fcy INNER JOIN (qry_Info_Pt INNER JOIN tbl_Referral ON qry_Info_Pt.MRN = tbl_Referral.MRN) ON tbl_Info_Fcy.ID = tbl_Referral.DischargeHosp

    To export the data I am right clicking on the query name

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    So it exports ID instead of Name? Does it export the LastName and FirstName values? Why do you need Name also?
    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.

  7. #7
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63
    It exports the autoID associated with each facility name and not the facility name itself. When I run the query in access I can see the names perfectly fine but when I export the data the autoID is what is visible.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Probably because of a lookup. Include the Facilities table in the query and pull the actual FacilityName field into the query.
    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.

  9. #9
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63
    Thank you so much!! Worked perfectly!

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

Similar Threads

  1. Export Access data to Excel
    By kaysersoze in forum Access
    Replies: 0
    Last Post: 01-21-2012, 12:25 AM
  2. Auto Export Data
    By Juan4412 in forum Import/Export Data
    Replies: 9
    Last Post: 09-02-2011, 07:23 PM
  3. Export Specific Data
    By Learner123 in forum Access
    Replies: 3
    Last Post: 05-29-2011, 11:27 AM
  4. Export data to .doc(x) file
    By fat drummer in forum Import/Export Data
    Replies: 0
    Last Post: 07-28-2010, 03:51 PM
  5. Can export data to Access, now what?
    By SilverSN95 in forum Access
    Replies: 5
    Last Post: 07-07-2010, 12:09 PM

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