Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Sending multiple query's in one attachment (email)

Discussion in 'Information Technology' started by Send Object Command - Two attachments, Jul 28, 2006.

  1. I send three query's (as excel spreadsheets) on a daily basis with the send
    object command in a macro. How can I combine these three query's to be sent
    in one email, one file, three seperate tabs (or Sheets) within one
    spreadsheet?

    Thank You.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Why This Sikh Cartoonist Is Sending A Postcard To Trump Every Day Breaking News Mar 23, 2016
    Canada Canada sending dossier on fraud immigration agents to Punjab Breaking News Sep 27, 2010
    Opinion Youth of Punjab facing multiple challenges: Dal Khalsa chief Punjab, Punjabi, Punjabiyat Mar 22, 2013
    It's not only immigrants who have multiple loyalties Hard Talk Jun 5, 2010
    Chardi Kala Jatha in United Kingdom - Multiple Gurdwaras Sahib Gurmat Sangeet Jul 21, 2008

  3. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    I used the vb below to transfer 3 queries out to a single spreadsheet. The
    spreadsheet did not exist to begin with. The first transfer creates it,
    silently. The second two append worksheets, silently. You may want to do
    some checking before the transfer so react to the file's existence or
    nonexistence before doing the transfer. Depends on how your app is written.

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query2",
    "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query20",
    "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query21",
    "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
     
  4. Rick, thanks for the response. However, is there anything that I can do
    without using code? Not too much of a code person....Can I just use basic
    Macro functionality?
    Thanks again.


    "Rick Wannall" wrote:

    > I used the vb below to transfer 3 queries out to a single spreadsheet. The
    > spreadsheet did not exist to begin with. The first transfer creates it,
    > silently. The second two append worksheets, silently. You may want to do
    > some checking before the transfer so react to the file's existence or
    > nonexistence before doing the transfer. Depends on how your app is written.
    >
    > DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query2",
    > "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    > DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query20",
    > "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    > DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query21",
    > "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    >
    >
    >
     
  5. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Just copy the code into the OnClick Event of a Command Button (Code
    Builder)
    & Modify the Parameters (Pressing F1 when the text cursor is somewhere
    inside "TransferSpreadSheet" will show help)
    TransferSpreadsheet can also be used in a macro (All DoCmd *are* macro
    actions), but you won't be able to set all possible parameters

    HTH

    Pieter

    "Send Object Command - Two attachments"
    <SendObjectCommandTwoattachments@discussions.microsoft.com> wrote in message
    news:98D6BE70-84E9-4026-BD19-55B650B051C3@microsoft.com...
    > Rick, thanks for the response. However, is there anything that I can do
    > without using code? Not too much of a code person....Can I just use basic
    > Macro functionality?
    > Thanks again.
    >
    >
    > "Rick Wannall" wrote:
    >
    >> I used the vb below to transfer 3 queries out to a single spreadsheet.
    >> The
    >> spreadsheet did not exist to begin with. The first transfer creates it,
    >> silently. The second two append worksheets, silently. You may want to
    >> do
    >> some checking before the transfer so react to the file's existence or
    >> nonexistence before doing the transfer. Depends on how your app is
    >> written.
    >>
    >> DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
    >> "query2",
    >> "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    >> DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
    >> "query20",
    >> "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    >> DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
    >> "query21",
    >> "c:\projects\currentdevelopment\TestMultipleQueryExport.xls", True
    >>
    >>
    >>
     

Share This Page