|
-
Sep 10th, 2001, 01:34 PM
#1
Thread Starter
Member
List box formating
Hi everybody. I am having problems with this code. It is truncating what ever is intered into this list box and cutting off all the 0's. Any ideas on how to fix this?
'Loading rates
Set m_oRecord = m_oConnect.GetRate
'As long as we have something...
cbStartRate.Text = Format(cbStartRate.Text, "0.000")
While Not m_oRecord.EOF
cbStartRate.AddItem m_oRecord.Fields(0).Value
m_oRecord.MoveNext
Wend
Thanks a bunch.
-
Sep 10th, 2001, 01:40 PM
#2
-
Sep 10th, 2001, 03:37 PM
#3
Thread Starter
Member
The width of the list box doesn't seem to matter. It still truncates the number and cuts off the rest of the 0's. Any other ideas?
-
Sep 10th, 2001, 04:47 PM
#4
Thread Starter
Member
-
Sep 10th, 2001, 04:54 PM
#5
Hyperactive Member
just a wild guess...
While Not m_oRecord.EOF
cbStartRate.AddItem m_oRecord.Fields(0).Value
cbStartRate.Text = Format(cbStartRate.Text, "0.000")
m_oRecord.MoveNext
Wend
Not sure of this one but give it a try...
-
Sep 10th, 2001, 08:02 PM
#6
PowerPoster
Hi
1) You are formatting the value and then adding the unformatted value to your listbox or combobox
2) You dont need to set the text property while looping
3) Use Format$ instead of Format - quicker
4) While.. Wend is not used nowadays but that wont cos a prob
Regards
Stuart
VB Code:
'Your code....
'As long as we have something...
cbStartRate.Text = Format(cbStartRate.Text, "0.000")
While Not m_oRecord.EOF
cbStartRate.AddItem [b]Format$([/b]m_oRecord.Fields(0).Value[b], "0.000")[/b]
m_oRecord.MoveNext
Wend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|