Queries on a Form + Report

D

Dreamer

Hello to all!

I have several related tables and I need to create a Query form, where, selecting options in:

1-Combo Box, and 2-check box 3-text fields, give back to the consultation in he himself form or another one to me ..... as a report.

Have some idea of as I can carry out this? Thanks to all!

Dreamer. -


PS. sorry for my bad english!
 
G

Guest

Dreamer,

If I'm reading this correctly, you want to create a form that is used only
to select the criteria for the records returned. Once that has been done,
clickig a button will show a second form and/or create a report. Is that
right?

If so, when the button is clicked, use the selected criteria to build an SQL
string, then store that SQL as a named Query, e.g. "qrySelectedCriteria".
(See CreateQueryDef in VBA Help.) Set the recordsource for both the user
form and your report to that name.

Depending upon the number of combo boxes, check boxes, etc., the code to
build the SQL could get pretty complicated, especially if different tables
are selected and linked. Suggest creating several common example queries
manually, then comparing what Access builds automatically with what your code
builds.

Be sure to delete the existing query each time before creating the new one.

HTH,
Bruce
 

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