Replacing a value in a combo box (1 Viewer)

KelMcc

Rock n' Roll Paddy
Local time
Today, 11:05
Joined
May 23, 2002
Messages
97
I'm trying to figure out something for this thread.

Basically, I have a form that has some combo boxes where you make some selections. You then click a button (on the same form) that launches a report that returns data based on the choices you made in your combo boxes.

On the report I have it so that if you pick a status type on the form ("Open", "Closed") that status will appear in the report header.

The problem is... on the form if you leave the field blank the report knows that means "All"... but I don't know how to tell that to the text field that populates the title.

OK... all that background for my question...

On the form, can I set it up so that the choice says "All", so the report can pick that up, but that the value that the "event procedure" reads is a blank?

Sorry, I know I'm not saying this well.
 

Travis

Registered User.
Local time
Today, 11:05
Joined
Dec 17, 1999
Messages
1,332
Change the Control Source of the Text field to:

=IIF([Combobox Filter value]="","All",[Combobox Filter Value])
 

KelMcc

Rock n' Roll Paddy
Local time
Today, 11:05
Joined
May 23, 2002
Messages
97
The problem is in the control source, I had this line:

= [Forms]![FISReports]![Status]

I changed it to this:

=IIf([Forms]![FISReports]![Status]="","All",[Forms]![FISReports]![Status])

But, it still behaves the same. If I leave a blank value on the form, it does not populate the word "All" in the text.
 

IgorB

Registered User.
Local time
Today, 19:05
Joined
Jun 4, 2003
Messages
183
I disagree with Travis.
1) We are talking about combobox selection, not a textbox.
2) We are trying use either "All" or real value as one source for combobox!!!

Solution:
1) Query for Combobox which murge values and "All"
Select field from TableName
UNION
Select "All" from TableName
2) Depend on combobox selection write VBA code that change report recordsource on a fly.

Igor.
 

KelMcc

Rock n' Roll Paddy
Local time
Today, 11:05
Joined
May 23, 2002
Messages
97
Problem solved by a fix on the report.

Thank you both for your help. :)
 

Users who are viewing this thread

Top Bottom