Subject: Run query & Exporting the Data to Excle
Posted By: anukagni Post Date: 1/20/2006 6:07:14 AM
 Ni Guy's,

  I have created an report through front end using an combo Box and an command button , "It Wroks". Now i want to run an query through front end similarlly by using combo box and command button and export the resulted data to excel sheet . But when i give the VB coding
 
 "'OpenQuery.
 Docmd.OperQuery "QueryName" , ............."


    I am geting the whole query running and whole data in the database, instead of getting the selected Names data and what is the command for exporting the data to excel?
  
          Weather i am able to get the data by runcommand option or by other
 Pls help me in this issue so that my head ill lose some weight.

 thanks in advance from my deep heart...


P.A.P.Raguv
Reply By: ajmil11 Reply Date: 1/20/2006 10:44:36 AM
You may want to set up a macro.
The first command would be to open the query.  If you have set the query up to prompt for input, it will do so.   Otherwise, the query will just run as you have set it up.
The second commmand can be transferspreadsheet, outputto, or use the runcmd and choose export.  

Hope this helps a little bit.

Reply By: anukagni Reply Date: 1/21/2006 3:49:12 AM
Hi,
   I.. want to know about the method to export the data to Excel but U.. told me run macro in the Access. Probs is I don't konw to creat and run macro i the access.But i can do it in Excel.Excel isn't it not similar to the access.pls give me an example in the issue so that i can able to start up with the macro in the Access .May be at the time of runnig the query or after getting the result from tje query..
  Thank for ur response., reply me wit out fail pls..
Bye

P.A.P.Raguv

Go to topic 38202

Return to index page 471
Return to index page 470
Return to index page 469
Return to index page 468
Return to index page 467
Return to index page 466
Return to index page 465
Return to index page 464
Return to index page 463
Return to index page 462