Solved

doCmd.TransferSpreadSheet query with parameters?

Posted on 2003-11-17
3
1,567 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

738 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