Re: Creating a Report via VBA



What if you build a query via code based on their choices, then output the resulting query to excel?

Something like:

DoCmd.OutputTo acOutputQuery, strSql, acFormatXLS, "OutpExcel.xls", True

Where strSql is the query built based on their selections. The above statement would also put them directly into excel.

Also, I'd be curiuos to see the form you come up with, if you care to post.

Hope this helps,

"RLN" <nospamrln@xxxxxxxxxx> wrote in message news:1212083501_587@xxxxxxxxxxxxxxxxxxxxx

In the past I've created some canned reports & given users access to
them via a simple menu. Now my users are asking if they can create
their own ad-hoc reports in their app.
Is there a simple way to do this?

I recently got the database container of my application secured from
users so all they have are forms with which add/edit (and with rare
exception, delete) data.
This app is split into front end/backend .mdbs.

If I give them:
-a form based on a table
-a list box on the form for choosing columns
-a criteria option group for selecting <,>,<=,>=,"Like*" ...etc.
- a sort order option group
- a group-by combo box with columns for choosing group by

...does anyone have a sample of creating a report from controls such as
these using VBA?

Thanks.

*** Sent via Developersdex http://www.developersdex.com ***

.


Quantcast