Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2006, 12:32 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default Exporting an Query

Hi all,


  I expreienced an problem which i feel new ..
 Iam having an table which having relation with other tables i.e.
 Iam having an Table called Employee name and it contain name of the Employee...and it have an primary key called Employee ID and i did the relation to the main to and the filed as Employee ID and the type of field is Number and i use combo box for its front end..i.e. from ! . Now the probs is when i creat the query and run it the result give the employee name but when i export it display the ID number in the excel sheet iam not having any idea about this issue..

 pls help me in this issue

pap
 
Old June 9th, 2006, 06:21 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   What you need to do is in the query designer, you need to show both tables, and don't select the Foreign Key in the one table, but use the name from the employee table.

   For example, using similar tables, instead of:

SELECT Order.CustomerID, Order.OrderID, Order.Item, Order.Qty
FROM Order

   (this will show the Customer name in the query, but will only export the CustomerID)

   DO this instead:

SELECT Customer.LastName, Customer.FirstName, Order.OrderID, Order.Item, Order.Qty
FROM Customer JOIN Order etc.

This will show the Customer FirstName and LastName (You can do [LastName] & ", " & [FirstName] As Name, etc) when you export the query results.

The important thing is to show the fields you want from the tables you want, and not the relationship fields in your queries. You will also get other negative results when creating reports etc.

Did this help?



mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting Query Data From Access to Excel JimInSouthernCal Access VBA 3 December 21st, 2007 08:34 AM
Chapter 16: Exporting query data to Excel 5tr0ud BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 0 October 9th, 2007 04:23 PM
Exporting an Access Query sideshow245 Access ASP 3 June 18th, 2006 07:05 AM
Run query & Exporting the Data to Excle anukagni Access 2 January 21st, 2006 04:49 AM
Exporting Query Results to Excel File redrobot5050 Access VBA 2 October 7th, 2004 05:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.