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

Loading arrays issue

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
Using the following code I have a questions. .Fields(intFldCntr) = 2.66666666666667 yet after loading it into arrWhite(intIndex), arrWhite(intIndex) = 3. I'm working to get some weighted averages so I want the actual number. How can I prevent it from being rounded when I load it into the array?
Thanks.

Dim arrWhite(rs.Fields.Count - 1) As Integer

intIndex = 0
Dim intTemp As Integer
With rs
For intFldCntr = 1 To .Fields.Count - 1
arrWhite(intIndex) = .Fields(intFldCntr)
intIndex = intIndex + 1
Next
End With
 
>Dim arrWhite(rs.Fields.Count - 1) As Integer

Replace As Integer with 'As Single' or 'As Double' perhaps.
 
Never dawned on me to try your suggestion. That did the trick. Thanks for help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top