Solved

doCmd.TransferSpreadSheet query with parameters?

Posted on 2003-11-17
3
1,538 Views
Last Modified: 2007-12-19
Hi I have a VB form that allows the user to choose the name of a company from a drop down list. I want to use the selected value of the drop downl list as an input to a access query. The results of this query I want to export to excel using the doCmd.TransferSpreadSheet command. DoCmd.TSS allows u to give it the name of a table or the name of a Select query, but how do I make sure my query's input parameter gets included.

my query looks like
  "Select * from Companies where ID=[x]"

I need to input the value of x into the query before I do the TSS, any ideas?

thanks
0
Comment
Question by:dav_evans
3 Comments
 
LVL 8

Accepted Solution

by:
Benjamin_Luk earned 125 total points
ID: 9769180
You query should be this:

"Select * from Companies where ID='"& Forms!MyFormName!Combo25 &"' "

revise myFormName as you real form name
and Combo25 as the name of your drop down list

Confirm you have open the form when you do the TSS, so you will not need input the value

Best Regards

Ben
0
 
LVL 9

Expert Comment

by:ornicar
ID: 10064201
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10103572
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: Benjamin_Luk {http:#9769180}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

stevbe
EE Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question