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

Float is rounding

Status
Not open for further replies.

MzKitty

Programmer
Oct 28, 2003
254
US
Hi. I'm using VS2008. I'm trying to load a textbox with the value from a float field (.25) and the value keeps rounding to 0. Here's an example of what I am trying to do:

Dim strString As Single

strString = rsPMData.Fields("AcreOrig").Value
txtOrigAcres.Text = CStr(strString)

I have also tried:

txtOrigAcres.Text = = rsPMData.Fields("AcreOrig").Value

and got the same results. I've been looking everywhere for a solution, but I'm hitting dead ends.

Thanks for any help you can give me. Cathy
 
Did you do a break on the line and check the actual value rsPMData.Fields("AcreOrig").Value is passing back? It isn't normal for any of that to change .25 to 0.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
I should be bald by now!! I ended up closing my rsPMData and setting my sql string to select just AcreOrig and I got the correct info. My app must lose focus as I move through it. Thanks for answering me. It helped me to try and figure out why I couldn't view the data in the field when I broke on the line. I've been stepping thru this thing all afternoon! Thanks again Sorwen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top