parameter query question

G

Grace

Hello, I have report which uses as it's source a parameter
query that prompts for a value for the [Issue] field. The
[Issue] value is selected off a form
[HelpDeskDetailbyIssueForm] so that the user may select a
value from the table tblIssueList.

The value in the query for the Issue field is: [Forms]!
[HelpDeskDetailbyIssueForm]![Issue]

Is there anyway that I could leave the [Issue] field blank
on the form so that ALL issues are include in the report?
Is there a way to use a "wildcard" search to get all
values?

Thank you,
Grace
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Assuming the column's name is [Issue] use a WHERE clause like this:

WHERE [Forms]![HelpDeskDetailbyIssueForm]![Issue] Is Null
OR ([Issue] = [Forms]![HelpDeskDetailbyIssueForm]![Issue]
AND [Forms]![HelpDeskDetailbyIssueForm]![Issue] Is Not Null)

or, if using the WhereCondition parameter of the OpenReport method,
the above without the WHERE keyword:

strWhere = "[Forms]![HelpDeskDetailbyIssueForm]![Issue] Is Null " & _
"OR ([Issue] = [Forms]![HelpDeskDetailbyIssueForm]![Issue] " & _
"AND [Forms]![HelpDeskDetailbyIssueForm]![Issue] Is Not Null)"

DoCmd.OpenReport "ReportName", WhereCondition:=strWhere

See the article about a database of query examples:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;182568

This db is where I got the above solution.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQC2qyoechKqOuFEgEQKnqACeJ1qgswOm8AMqt6uRBC48E2wDaAgAoKXf
EKyilDLKR/VGSsrCNv+IAHLt
=c2g9
-----END PGP SIGNATURE-----
 

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