Computing.Net > Forums > Programming > vb control array

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

vb control array

Reply to Message Icon

Name: Linda Tran
Date: November 19, 2003 at 17:26:48 Pacific
OS: xp
CPU/Ram: 256
Comment:

Hi,

How do I make vb add the total of certain fields from a Microsoft Database?

For example if the first field was "quantity"
and the second field was "price", using a control array it would be
label1(0).caption * label1(1).caption="total price for total quantity" right?

But how would I go about doing this if there is more than one entry in both of the fields? For example if I had 5 different prices for 5 differnty quantities?

I'm pretty sure there might be a For next loop in this problem since I have tried it but it just keeps giving me an error :)



Sponsored Link
Ads by Google

Response Number 1
Name: Infinite Recursion
Date: November 19, 2003 at 21:25:29 Pacific
Reply:


Depends on how your fields are returned and to what component they are returned...

If it was a text box as a control array then...

----
for i = 0 to N
sum = sum + Val(txtBox(i).text)
next i
----

Show us the code that you have so far, so it can be clear what you are trying to do.

IR


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: vb control array

control array www.computing.net/answers/programming/control-array/7205.html

C++ array of buttons www.computing.net/answers/programming/c-array-of-buttons/9721.html

VB6 control arrays www.computing.net/answers/programming/vb6-control-arrays/8348.html