Query By Form into a Report

  • Thread starter Roger Tregelles
  • Start date
R

Roger Tregelles

I have many Query By Forms that I use to display
information form our databases. The main advantage of the
QBF method is that the users don't get dropped out of the
switchboard, and they don't need to learn complex query
strings either.

What I need to be able to do is pass the information
collected by the QBF directly into a Report that can be
printed, etc. Any ideas on how to do this? I wish I could
find a good sample database that demonstrates exactly how
to do this. Thanks in advance for any and all help and
direction provided.

Roger Tregelles
Quality Manager
Thule Inc.
 
D

Duane Hookom

There is a query by form applet at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. This
applet consists of a couple tables and several forms that can be imported
into any application mdb. It allows users to select fields, set sorting,
apply grouping and criteria, etc. The "designs" are saved in the tables for
future modification and use. Results of the query are displayed in a
datasheet subform with two clicks to send the records to print, html, csv,
Excel, Word Merge, Word Table, or graph.
 
R

Roger Tregelles

Duane,

Thanks for the quick reply and directing me to your
excellent Applet. Unfortunately I'm having a slight
problem when I use it. I imported everything except the
sample tables per the directions. I then deleted all of
the records as well. When I open the main form and click
on "New Report" I get the following error.

Microsoft Visual Basic
Compile Error:
User-Defined type not defined

The error occur on this line in the Private SubForm
section:
Dim db As DAO.Database

I'm running Access 2000 9.0.3821 SR-1. Any help you could
provide would be greatly appreciated. Thanks so much.

Roger Tregelles
Quality Manager
Thule Inc.
 
D

Duane Hookom

1) did you create one or more master queries?
2) open any module and select Tools|References and scroll to find "Microsoft
DAO 3.x..." and check it.
3) compile the code and you should be good to go.
 
R

Roger Tregelles

Duane

Thanks again for helping me out. I'm only a novice, so I
appreciate your patience here. Here's my answers to your
latest questions.

1. I'm not sure I understand what a "Master Query" is. I
have some queries made but am not sure how to determine
what type they are.

2. There are no modules in this database. I used ALT + F11
to open the Visual Basic Editor and then checked the
Microsoft DAO 3.5.1 (there was also a 3.6 version). It was
not checked previously.

3. I compiled the code and tried your query again, and
still get the same error. What am I still doing wrong
here? I appreciate any help you could provide.

Also, are there any books you could recommend to help me
grow my skills in Access. I went to 3 different courses at
New Horizons for Access 2000 (Level 1, 2, 3) and feel like
I know nothing in comparison to someone with your
extensive skill set. Thanks so much, I look forward to
hearing back from you.
 
D

Duane Hookom

1. a master query is any saved query that you create with a query name
beginning with "<". These create the data sources for users to select. You
can create as many of these as you like and they can combine two or more
tables.
2. check only one DAO object library and probably the highest numbered
3. possibly uncheck the Reference to ADO in tools|references

For book recommendations, check John Viescas site www.viescas.com. The books
he has authored or contributed to are very well done and comprehensive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top