UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Button To Send Query Results To Excel, Office 2013    
 
   
Dexter
post Jul 10 2018, 10:43 AM
Post#1



Posts: 696
Joined: 5-November 07



I have an access database with a form intended to search data. The end user can select criteria and click a search button and a series of SQL statements are executed and displayed in a subform. I now want to be able to capture the search result showing in the subform and export it to excel. How can I do that? Thanks!
Go to the top of the page
 
ranman256
post Jul 11 2018, 07:09 AM
Post#2



Posts: 876
Joined: 25-April 14



Docmd.transferspreadsheet acExport, ......"qsSubFormQry".....
Go to the top of the page
 
dflak
post Jul 11 2018, 09:05 AM
Post#3


Utter Access VIP
Posts: 6,230
Joined: 22-June 04
From: North Carolina


You can pull the data from the excel side using MS-Query. MS-Query has the ability to send parameters back to the database. In fact, some of these parameters can be read from cells with formulas like =TODAY()-30 or maybe a user-selectable drop-down list. The data are imported into an Excel Table.
Go to the top of the page
 
Dexter
post Jul 11 2018, 01:37 PM
Post#4



Posts: 696
Joined: 5-November 07



I tried this already and it extracted the entire query, not with the filters selected on the form.
Go to the top of the page
 
dflak
post Jul 11 2018, 01:40 PM
Post#5


Utter Access VIP
Posts: 6,230
Joined: 22-June 04
From: North Carolina


With MS-Query, you do not set up the parameters in the MS-Access query, you set them up on the Excel side of the house.

See if the attached "walk through" helps.


Attached File(s)
Attached File  MS_Query_Test.zip ( 405.05K )Number of downloads: 2
 
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    20th October 2018 - 11:01 AM