Set 0 Values in table as Blank in Listbox

marabak

Registered User.
Local time
Today, 15:37
Joined
Nov 4, 2015
Messages
14
Hey.

Basically, my question is as the title suggests. I have a table which is populated via an INSERT SQL using VBA to adapt to the information that I want to store in the table. If the SQL adds a new entry but the field isn't specified in the SQL, it sets 0 as a value.

On my form I have a listbox containing the information from the relevant table and it is displaying the 0 in the field at that point. Is there anyway to make this more aesthetic by "hiding" the zero's in the listbox?
 
In the row source query you could have:

IIf(FieldName = 0, "", FieldName)

or

IIf(FieldName = 0, Null, FieldName)
 
Hi pbaldy

The rowsource is currently directed straight to the table. Is the only way to create a query pulling all of the information from the table then?

Thank you
 
Well, if the row source is the table you'll get whatever is in the table. If you want to display something other than what's in the table, you'll need a query.
 

Users who are viewing this thread

Back
Top Bottom