In Access, you would use the TransferSpreadsheet action, but that won't work
with parameter queries.  You'll probably have to open the QueryDef, provide
the parameters via the Parameters collection, open a recordset on the
QueryDef, and then start an automation session to Excel to write the values
to your spreadsheet.  You can do something similar in ADO using the Catalog.
I know later versions of Excel have a CopyFromRecordset method for a Range,
but I'm not sure about Excel 97, and I think that requires a DAO recordset,
not ADO.

John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Mahesh kumar
Sent: Tuesday, January 10, 2006 5:10 AM
To: [email protected]
Subject: [ms_access] Sending parameters from VB form to MS-ACCESS query and
executing Macro

Hi,
   
    I am developing an application with the following ..
  VB6.0, MS-Office 97 and ADO2.6
   
  I want to export some data based on query to excel.
   
  I have created a query and a macro in ms-access. query1 will have to
parameters date1 and date2. Macro1 is defined as Action->OutputTo , object
type -> query, Object name-> query1 and output format ->Microsoft Excel
(*.xls).
   
  eg. query1 -> select * from employee where doj between date1 and date2
  macro1 -> uses query1 and exports the output to excel.
  Now my requirement is how can send date1 and date2 values from VB
application to query stored in database and how can i execute the macro from
VB application.
   
  Can anybody help me out....
   
   
  Thanks in advance
   
  regards,
  Access_mk
   

                
---------------------------------
Yahoo! Photos - Showcase holiday pictures in hardcover
 Photo Books. You design it and we'll bind it!

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links



 






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to