[AccessD] Access Toolbar Question

Steve Schapel miscellany at mvps.org
Wed Sep 5 00:28:32 CDT 2007


Arthur,

You can use code to dynamically control the number of columns in a 
report based on a crosstab query.  I think I could dig out some sample 
code if you're interested.

Otherwise, couldn't you use either DoCmd.OutputTo or 
DoCmd.TransferSpreadsheet to get the crosstab query data into an Excel file?

Regards
Steve


Arthur Fuller wrote:
> Version: A2k3, classic FE/BE arrangement.
> No Customization of Toolbars. Central UI is the classic switchboard,
> customized by me.
> Problem: When running an MDB crosstab report, that is date-scoped, one
> cannot predict the number of columns (let's say it's scoped by day), but the
> user may choose something larger or smaller than the default "this week"
> date range. So one cannot predict the number of columns, and therefore a
> report as such is out of the question, since it's a crosstab. The obvious
> alternative (already in place) is to DoCmd.RunCommand.OpenQuery(blablabla),
> which works a treat. However, the "Export to Excel" button has disappeared
> from the toolbar. I want to provide a one-click "export to Excel" of the
> resultant xtab and in Excel the user can format and customize to suit.
> 
> I am aware that this is a tad the "lazy man's approach" but I'm doing this
> for a friend and I've already spent way more time satisfying petty
> requirements than the pay deserves, but that's what you get for hiring me.
> The friend in question is perfectly willing to accept an Excel spreadsheet
> as the output. Given that I'm in a query, however, rather than a form, I
> can't exactly plonk on a button. Said "Export to Excel" button used to be
> there, but I don't know where it's gone.
> 
> Any suggestions? (I've never had joy with custom toolbars; perhaps because I
> never understood them fully, but that's beside the point.) I just want to
> locate and reveal those "Export" buttons, most importantly Excel but perhaps
> also including the Word button.
> 
> What to do?
> 
> TIA,
> Arthur



More information about the AccessD mailing list