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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal Places in a List Box

Status
Not open for further replies.

TommyF

Technical User
Oct 28, 2001
104
I have a list box that I fill with data using the code as follows.

Private Sub Form_Current()
Me.List0.RowSource = _
"SELECT ID, linkid, Deldate, TITLE, IMPS FROM DelNotes " & _
"WHERE linkid = " & Me.LinkID & _
" ORDER BY Deldate DESC"
End Sub

This works fine except the IMPS field is a number which needs to have 3 decimal places, at the moment it will bring it up with 2(which must be standard). I have changed all the tables etc to be 3 decimal places but it does not change.

Is there any way to add this to my code so it formats the Imps colum when it loads the data.

Thanks
 
One, admittedly clunky, way is:
Code:
Private Sub Form_Current()
Me.List0.RowSource = _
"SELECT ID, linkid, Deldate, TITLE, Format(IMPS,'0.000') AS IMPSNum FROM DelNotes " & _
"WHERE linkid = " & Me.LinkID & _
" ORDER BY Deldate DESC"
End Sub
[pc2]
 
Thanks mp9 that worked fine except it changed the colum head to exp1004. Is there anyway to change this?

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top