Re: Text for numbers in option group AND filter based on previous
- From: Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Dec 2006 10:47:01 -0800
The combo box approach will not prevent you from doing any of the other
things you want. When you want to refer to the number, it would be:
Me.MyCombo
When you want to refer to the text, it would be:
Me.MyCombo.Column(1)
As to the IIf, the combo box would make that even easier:
=IIf([optExample]=1,"Sufficient",IIf([optExample]=2,"Insufficient","Surplus"))
Could be:
=Choose(Me.MyCombo, "Sufficient", "Insufficient", "Surplus")
If the above goes in a query, it would have to be:
=Choose([Forms]![MyFormName]![MyComboName], "Sufficient", "Insufficient",
"Surplus")
"Annemarie" wrote:
Thanks, that would work great, but the idea was not to take up space.
with a table that displays the names for the three numbers. It is much
better to tell the database to name the numbers a certain thing (the
Iff statement i posted). Also i need that list/combo/text/check
whatever it ends up being to filter the next list box (codes are
already set up for this action). the check boxes would be ideal only
because eventually the user could search by multiples....(ex filter the
next list box by all sufficient and surplus entries). Both tasks are
operational in different forms, i just need to combine the two. the
combo box showing the name is moving in the right direction but does
not apply to the concept of the form. Somehow i need to combine the
SELECT DISTINCT statement with the IFF statement...
Any thoughts?
Klatuu wrote:
I would suggest a Comb rather than a List Box or Check Boxes. Make the Combo
a two column combo:
1 Sufficient
2 Insufficient
3 Surplus
You can set the ColumnWitdths property to 0";.5" so the numeric column is
hidden.
Also ColumnCount = 2 and Bound Column = 1.
(The .5" for the second column is just a guess at how wide it needs to be to
be displayed correctly.
Now, the user will see the text but not the number.
You really don't need a text box to show the text value, it will be
displayed in the combo.
"Annemarie" wrote:
Hello,
I am trying to combine two tasks that I can get to perform separately
but not together. I have a list box that filters the contents of a
second list box based on the row source. This is working perfectly the
way I want it. I am using the contents in a table from a field
(optExample) derived on a form from an option group (so it returns
numbers 1, 2, 3). In a normal text box I can get these values to
return the text values associated with the numbers. I would like to
filter a list box based on the values from the field optExample, yet
show the text values associated with the numbers instead of the 1, 2,
3.
In the working example of the first list box, the control source is
unbound and the row source is ...
SELECT DISTINCT [space use validation].optExample FROM [space use
validation];
In the working example of returning text values in place of the number
values the control source of an unbound text box is as follows....
=IIf([optExample]=1,"Sufficient",IIf([optExample]=2,"Insufficient","Surplus"))
How can I combine these so the list box returns Sufficient and
Insufficient rather than 1 and 2 as choices? I need this to still
successfully work with the filtering performed through the form.
If this can be accomplished by check boxes for each Sufficient,
Insufficient, and Surplus this would be another option, if not ideal in
this situation.
Thanks in advance if anyone has suggestions
Annemarie
- Follow-Ups:
- References:
- Prev by Date: Re: The expression ON CLICK you entered as the event property ...E
- Next by Date: Re: Text for numbers in option group AND filter based on previous
- Previous by thread: Re: Text for numbers in option group AND filter based on previous list
- Next by thread: Re: Text for numbers in option group AND filter based on previous
- Index(es):
Relevant Pages
|