Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!

Download and Activate to enter!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Download to Enter | Contest Rules

Learn More!

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 30th, 2004, 02:04 PM
greetInfo greetInfo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 71 greetInfo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 30 sec
Reputation Power: 8
Docmd.Outputto Help

I am trying to output the result of a query to an excel worksheet. But I
want only the filtered data to go to the sheet. Records are filtered based
on the user input on a form. The command I am giving is as follows:

DoCmd.OutputTo acQuery, "Get_country_Info", "MicrosoftExcel(*.xls)", "C:\Documents and Settings\sagarwal\My Documents\Database\test.xls", True, ""

where "Get_Country_Info" is a predefined query.
It gives me the details of all the countries but I only want the countries which the user selects from the list box in the form

Is there a way I can write the query itself in the OutputTo command? I tried to substitute the query itself instead of passing the query object as follows:

DoCmd.OutputTo acQuery, "select country_name from country where country_name in ( " & tempcountry ")", "MicrosoftExcel(*.xls)", "C:\Documents and Settings\sagarwal\My Documents\Database\test.xls", True, ""

where tempcountry is a list of selected countries by the user. But it gives me an error saying
"database engine could not recognize the oblect 'select country_name from country where country = 'USA'' "

Any ideas??? Thanks in advance.

Reply With Quote
  #2  
Old September 5th, 2004, 06:37 PM
dd944 dd944 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 dd944 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
DoCmd.outputto Help

Check out this link. This is a solution to your problem but it does not use the Docmd.

http://www.microsoft-accesssolutions.co.uk/query_using_listbox.htm

John

Reply With Quote
  #3  
Old September 9th, 2004, 04:05 PM
greetInfo greetInfo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 71 greetInfo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 30 sec
Reputation Power: 8
Thanks

Thanks a lot. That is exactly what I was looking for. Appreciate your help

Regards,
GreetInfo


Quote:
Originally Posted by dd944
Check out this link. This is a solution to your problem but it does not use the Docmd.

http://www.microsoft-accesssolutions.co.uk/query_using_listbox.htm

John

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Docmd.Outputto Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 



Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap