|
-
October 8th, 2001, 03:44 PM
#1
MDI Projects
In a multiple-form MDI project, how can you add "totals" of mathematical procedures from each child form together, so the grand total shows in the GRAND TOTAL label in another child form?
-
October 8th, 2001, 10:10 PM
#2
Re: MDI Projects
keep the totals as public variables in the respective forms
GRAND_TOTAL = val(form1.totals) + val(form2.totals) + ...
Is this what u need?
If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it 
-
October 9th, 2001, 01:29 AM
#3
Re: MDI Projects
You could do somethign like this:
Dim frm as Form
Dim dTotal as Double
on error resume next
for Each frm In Forms
dTotal = dTotal + CDbl(frm.txtTotal.Text)
next frm
' or in case you only need forms of a specific type
' like when you create multiple instances of a form
' using: Dim somefrm as new frmChild
Dim frm as Form
for Each frm In Forms
If TypeOf frm = frmChild
dTotal = dTotal + CDbl(frm.txtTotal.Text)
End If
next frm
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
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
|