Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting rid of zeros in my list box!!

Status
Not open for further replies.

ribhead

Technical User
Jun 2, 2003
384
0
0
US
I have created a list box that is simply pulling in queried information. In this list are basic numbers and percentages. The table has been formatted to have 0 decimal places for the percentages and a Null value for default value. However I am getting .00% and a lot of 0 where no information has been entered. Is there an option I'm not seeing? Any help would be greatly appreciated.

Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
Have you trying to play with Format([numeric field], '#') in the query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH I have made the number format in the Query match the table (No decimal places) and I'm still getting .00%

Thanks for the reply

Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
What is the RowSource property of the ListBox ?
If simply the name of a query, what is the SQL code ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH

SELECT * FROM Query2;

Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
What is the SQL code of Query2 ?
Which numeric fields in this query exhibit the unwanted behaviour ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH I just copied the SQL view so it will look a bit ugly

SELECT tblprod.Counter, tblprod.[Date entered], tblprod.[Time entered], tblprod.Comments, tblprod.Department, tblprod.[Machine area], tblprod.[Clock number], tblprod.Shift, tblprod.[Part number], tblprod.[Op number], tblprod.[Route ID], tblprod.[Hrs earned], tblprod.[Number ran], tblprod.[Percent prod], tblprod.[Percent of rate], tblprod.[S/U allow], tblprod.[S/U complete], tblprod.[S/U perc], tblprod.Scrap, tblprod.DPM
FROM tblprod
WHERE (((tblprod.[Date entered]) Between Now() And Now()-90))
ORDER BY tblprod.[Date entered] DESC , tblprod.[Time entered] DESC;

Trouble fields are [Percent Prod],[Percent of rate],[Scrap],[DPM]. The last two should be "" if 0 and the others should just be 50%

Thanks

Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
Try to set the RowSource to something like this:
SELECT Counter, [Date entered], [Time entered], Comments, Department, [Machine area], [Clock number], Shift, [Part number], [Op number], [Route ID], [Hrs earned], [Number ran], Format([Percent prod],'#%'), Format([Percent of rate],'#%'), [S/U allow], [S/U complete], [S/U perc], Format(Scrap,'#'), Format(DPM,'#')
FROM tblprod
WHERE [Date entered] Between Now() And Now()-90
ORDER BY [Date entered] DESC , [Time entered] DESC

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH,
I pasted the statement but my field names changed. I tried using the AS statement but got a circular reference type error. The Percentages in the Query looked the same as before no .00%

Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
but my field names changed
???

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH sorry but I can't remember the exact name but it said Expr<>[Percent of rate]. I keep having to get out of it because people are trying to put in their information. Again sorry for being brief but in the last hour I've got ten thousand problems. I guess that's why the pay me a bit more than minimum wage eh?



Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
Anyway, the basic idea was to play with the Format function in the Rowsource property of the ListBox.
Have you tried that ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
When I get done putting out all the fires I will give it a shot!

Thanks alot PH

Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top