PDA

View Full Version : Solved: Listbox Problem



slchslch
09-12-2005, 08:56 PM
Hey,
i have a listbox which display some boolean data.
Is there a method to change the style of displaying the boolean data instead of just showing (1 or 0) or (True or False). Can i show like "Tick" for true value and "cross" for false value and etc.!

thanks for reading and your consideration!

jadedata
09-13-2005, 07:44 AM
Build a query and use the query as the source for the list box.

select True as ListValue, "Yes" as ListText
union
select False as ListValue, "No" as ListText
From anytablename
(you could actually use a real table for this...)


use both columns in the listbox

I suggest also that you keep the booleans in a "hidden" (zero width) column to use if needed as boolean datatypes.... not required though!

geekgirlau
09-15-2005, 05:31 PM
Did this solve your problem? Don't forget to mark the thread as solved!

slchslch
09-15-2005, 06:05 PM
okie this is my way to solve this problem...although it's a bit weird but it's work as what i intend to....

instead of using listbox to show the data,i choose sub form to replace it!
I created a form,using record source to pull the data which i want from the table.In the form itself ,i place the checkbox and the form itself i tie with the table together. Name the checkbox as the same name with the table field name.Haha..it's works...anyway...thanks for reading and consideration!http://vbaexpress.com/forum/images/smilies/friendship.gif

geekgirlau
09-15-2005, 06:38 PM
Yes, one of my pet peeves is the fact that you don't have control over the format of data displayed in a list box without changing the data type - bit of a nuisance for dates and boolean values! Oh well, another item to mention to Bill Gates next time he calls.