Transferring multiple queries in single form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have three crosstab queries that needs to be placed at the different
ranges in the same excel sheet .
How can I achieve this with do.cmd.transferspreadsheet.

Dim strQName As String
strQName = "7a-query"
Dim strNewName As String
strNewName = "c:\file.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strQName,
strNewName, True

I have the sample code here.
Now, how can I put the second query(which is 7b-query) on the same
tab,"7a-query" at the range, G2?
Thanks,
Prasanna.
 
If you look at the definition of the TransferSpreadsheet method in the help
you will see it has a Range attribute.

Steve
 
Hello Steve,
Thanks for the response.However, I hardcoded the range G2 in the attribute,
the query always populates in A1.
thanks,
Prasanna.
 
G2 is not a range. Try G2:X?

Steve

Prasanna said:
Hello Steve,
Thanks for the response.However, I hardcoded the range G2 in the attribute,
the query always populates in A1.
thanks,
Prasanna.
 
Back
Top