How to create report in VBA

  • Thread starter Thread starter Tony Girgenti
  • Start date Start date
T

Tony Girgenti

In Access XP, i created a form in VBA to accept criteria that i use to
extract data from linked tables thru external set of ODBC data and then i
create a flat ascii file from that. It works fine.

I'd like to know the best way to create a report using the same data that is
used to create the file.
Once i have the data, i'd like to allow the user to create the file, print a
report or both.

Any help that can be provided would be grearly appreciated.

Thanks,
Tony
 
There are commands to create every (or almost every) object that can reside
in an Access database. Few of us use them because there is almost never a
compelling need to create things like reports in "real-time"... and it is
decidedly non-trivial.

I'd suggest some advanced books on Access, such as the _Access
<versionnumber> Developer's Handbook_ by Litwin, Getz, et al, published by
Sybex, or some heavy duty searching of the Knowledge Base at
http://support.microsoft.com and the Microsoft Developer Network site at
http://msdn.microsoft.com.

Larry Linson
Microsoft Access MVP
 
The is a sample Query By Form applet at
http://www.rogersaccesslibrary.com/OtherLibraries.asp.
The DH QBF is a complete query by form applet that can be easily integrated
into any existing Access application. Typically, the functionality provided
by DH
QBF can replace many "canned" reports. The developer imports several forms
and
two tables from the DH_QBF.mdb, creates some master queries, and deploys.

The developer creates one or more master queries that join tables, alias
field
names, create calculated columns, etc. The users can then select a master
query
(datasource) from a drop-down and then select up to 30 fields from the
master
query. Users can define sorting and criteria as well as grouping and
totaling. All of
this "design" information is stored in two tables for re-use.

The results of the queries are displayed in a datasheet subform contained in
a main
form. The main form has options to send/export the records to print, Word
table,
Word merge, Excel, HTML, CSV, or a graph. Most formats allow the user to
automatically open the target application. The Word merge process will open
a new
Word document and link to the merge fields.
 
Back
Top