Newsbie: Can I check filter dialogue.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
In my query I have a filter of 'Like [Enter Assigned To Name (Leave Blank
for ALL):] & "*"' which display a dialogue box so the user can enter an
Assigned to Name to fileter on.

What I would like to do is check if nothing was entered (so all issues are
displayed), and in a text box on my report display 'ALL' instead of the text
box being blank.
 
You can add another field to the query that include the filter, like

Select TableName.* , IIf([Enter Assigned To Name (Leave Blank for
ALL):]="","ALL", [Enter Assigned To Name (Leave Blank for ALL):]) As
NewFieldName From TableName Where FieldName Like [Enter Assigned To Name
(Leave Blank for ALL):] & "*"

In the report or form you can refer to the new field
 
You can apply a format to the value in the report. If you are referencing
the parameter as the source for a control, then set the controls format
property

Format: @;"ALL"

That should show the value of [Enter Assigned To Name (Leave Blank for
ALL):] unless it is null. If it is null, then it will show "ALL".

If you are concatenating the value into a string, then you should be able to
do the same thing using the format function or an IIF statement.

"Report on " & Format([Enter Assigned To Name (Leave Blank for ALL):]
,"@;""ALL""")

Or

IIF([Enter Assigned To Name (Leave Blank for ALL):] & "" = "", "ALL",
[Enter Assigned To Name (Leave Blank for ALL):])

"John please don't spam me!"
 
Thanks, Guys - IT's working.
--
Kind Regards
John.


John Spencer said:
You can apply a format to the value in the report. If you are referencing
the parameter as the source for a control, then set the controls format
property

Format: @;"ALL"

That should show the value of [Enter Assigned To Name (Leave Blank for
ALL):] unless it is null. If it is null, then it will show "ALL".

If you are concatenating the value into a string, then you should be able to
do the same thing using the format function or an IIF statement.

"Report on " & Format([Enter Assigned To Name (Leave Blank for ALL):]
,"@;""ALL""")

Or

IIF([Enter Assigned To Name (Leave Blank for ALL):] & "" = "", "ALL",
[Enter Assigned To Name (Leave Blank for ALL):])

"John please don't spam me!"
Hi,
In my query I have a filter of 'Like [Enter Assigned To Name (Leave Blank
for ALL):] & "*"' which display a dialogue box so the user can enter an
Assigned to Name to fileter on.

What I would like to do is check if nothing was entered (so all issues are
displayed), and in a text box on my report display 'ALL' instead of the
text
box being blank.
 

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

Back
Top