Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for calling parameter query from VB

Status
Not open for further replies.

barbarafloyd

Programmer
Sep 7, 2004
4
US
Hi,

I have a button which runs a query and copies the contents to Excel
eg:
strQuery = "MyQueryName"
objDB.Execute _
"SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFile & _
"].[" & strWorksheet & "] FROM " & "[" & strQuery & "]"
objDB.Close

Now I have changed the Query to require a parameter to be passed to it.
Does anyone know the syntax I should use to incorporate this into my code?
E.G i tried:
strQuery = "MyQueryName(myParam)"
but I think i have the syntax for passing a parameter wrong

thanks for any help you can give!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top