Hi,
I have a query that uses a parameter, and I want to use that query as the
argument in a transferspreadsheet command.
Only I can't seem to work out how I provide the value for the parameter before the spreadsheet transfer is run.
I have...
But when the XLS_Export uses the xlsMyQuery as the
argument, I am still getting the query parameter value dialog box request.
Is it possible to 'save' parameter values in queries, I can't seem to work it out if it is possible.
I've tried passing the QD object to the transferspreadsheet method, but it didn't like that, I've also tried using a recordset object and passing that to the XLS export, but again invalid data type.
I believe the transferspreadsheet
parameter will only accept a string value of the name of either a table or a query.
Looking around one possibility that sprung up is to replace the query parameter with a UDF where I could dynamically provide the value that way, but before I go refactoring, I thought I'd ask you guys if it was possible with a query parameter.
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I have a query that uses a parameter, and I want to use that query as the
Only I can't seem to work out how I provide the value for the parameter before the spreadsheet transfer is run.
I have...
Code:
Dim sFile As String
Dim qdQuery As QueryDef
Set qdQuery = CurrentDb.QueryDefs("xlsMyQuery")
' RCM's can only see their own data
If oUser.Job = "Regional Compliance Manager" Then
qdQuery![RCM] = oUser.Name
Else
qdQuery![RCM] = "*"
End If
sFile = XLS_Export("xlsMyQuery")
But when the XLS_Export uses the xlsMyQuery as the
Is it possible to 'save' parameter values in queries, I can't seem to work it out if it is possible.
I've tried passing the QD object to the transferspreadsheet method, but it didn't like that, I've also tried using a recordset object and passing that to the XLS export, but again invalid data type.
I believe the transferspreadsheet
Looking around one possibility that sprung up is to replace the query parameter with a UDF where I could dynamically provide the value that way, but before I go refactoring, I thought I'd ask you guys if it was possible with a query parameter.
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music