Print content of a form list box in a report

G

Guest

Thanks for the valuable help I have got in this forum so far.
Another, and probably simple question:
I have a form where I ,through three parameters selected in combo boxes,
populate an unbound list box with records. The list box has five columns.
I want to be able to print a report that has all the records and fields in
the list box.
This is probably simple, but I have not been able to find an exampleI can
adjust for my purpose. Thanks for any help.
Niels
 
A

Allen Browne

The list box will have a RowSource property that defines the 5 columns and
the records. You can create a query that selects the same fields and
records, and use that as the RecordSource for your report.
 
G

Guest

Thanks Allen. Your advice is always appreciated. However, I still have some
problems, but let me post the query that the form is based upon:

SELECT qryParam3.ProjectID, qryParam3.Projectsymbol, qryParam3.Title,
qryParam3.Region, qryParam3.Status, qryParam3.StatusDate, qryParam3.Budget,
qryParam3.SubjectName
FROM qryParam3
WHERE (((qryParam3.Region)=[Forms]![frmParam3Test]![cboRegion]) AND
((qryParam3.Status)=[Forms]![frmParam3Test]![cboStatus]) AND
((qryParam3.SubjectName)=[Forms]![frmParam3Test]![cboSubject]));

The report called by the print/print preview button on the form comes out
fine except when one or more of the choices in the combos are **ALL**, then
the report returns blank. The **ALL** is added to to each combo (here is one
example):

SELECT tblSTATUS.Status FROM tblSTATUS UNION SELECT "**ALL**" as Bogus from
tblstatus
ORDER BY tblSTATUS.Status;

Niels
 
G

Guest

I think I figured it out by adding ..OR criteria="**ALL**

NielsE said:
Thanks Allen. Your advice is always appreciated. However, I still have some
problems, but let me post the query that the form is based upon:

SELECT qryParam3.ProjectID, qryParam3.Projectsymbol, qryParam3.Title,
qryParam3.Region, qryParam3.Status, qryParam3.StatusDate, qryParam3.Budget,
qryParam3.SubjectName
FROM qryParam3
WHERE (((qryParam3.Region)=[Forms]![frmParam3Test]![cboRegion]) AND
((qryParam3.Status)=[Forms]![frmParam3Test]![cboStatus]) AND
((qryParam3.SubjectName)=[Forms]![frmParam3Test]![cboSubject]));

The report called by the print/print preview button on the form comes out
fine except when one or more of the choices in the combos are **ALL**, then
the report returns blank. The **ALL** is added to to each combo (here is one
example):

SELECT tblSTATUS.Status FROM tblSTATUS UNION SELECT "**ALL**" as Bogus from
tblstatus
ORDER BY tblSTATUS.Status;

Niels




Allen Browne said:
The list box will have a RowSource property that defines the 5 columns and
the records. You can create a query that selects the same fields and
records, and use that as the RecordSource for your report.
 

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