Kumar-
If you want to always export to XLSX format, try this:
DoCmd.OutputTo acReport, stDocName, acFormatXLSX
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of access_kri
Sent: Monday, May 13, 2013 10:06 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Export report from Access 2007 to excel xlsx
John,
The code behind the command button is as given below:
Dim stDocName As String
stDocName = "Usys_rptSearch"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
DoCmd.OutputTo acReport, stDocName
DoCmd.Close acReport, stDocName
Thanks and Regards,
Kumar
--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...>
wrote:
>
> Kumar-
>
> What is the code behind the command button?
>
> John Viescas, Author
> Microsoft Access 2010 Inside Out
> Microsoft Access 2007 Inside Out
> Microsoft Access 2003 Inside Out
> Building Microsoft Access Applications SQL Queries for Mere Mortals
> http://www.viescas.com/ (Paris, France)
>
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of
> access_kri
> Sent: Monday, May 13, 2013 4:46 AM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Export report from Access 2007 to excel xlsx
>
> Dear All,
> I converted my MS Access 2003 database to MS Access 2007. I had
> one command button to export the report to excel. Now when I am not
> getting the option to export the output to xlsx? How can I export to
> excel with Access 2007?
>
> Kind Regards,
> Kumar
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
------------------------------------
Yahoo! Groups Links
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar