Beginner question about using a second form

ReggieBush25

New member
Joined
Feb 18, 2009
Messages
2
Programming Experience
Beginner
I'm a beginner and now I'm not exactly sure how I would use info from one form and post the results on a second form. This is the stuff I'm trying to get to the second form. Thanks.

VB.NET:
 If radcommuter.Checked Then
            deccost = deccost + 200
        End If
        If radresident.Checked Then
            deccost = deccost + 300
        End If
        If radfaculty.Checked Then
            deccost = deccost + 400
        End If
        If radcarpooler.Checked Then
            deccost = deccost + 200
        End If
        If radseniorfaculty.Checked Then
            deccost = deccost + 500
        End If

        If i = 1 Then
            deccost = deccost * 2
        End If
        If i = 2 Then
            deccost = deccost * 3
        End If

        If chkover65.Checked Then
            deccost = deccost * 0.9
        End If
        If chkhandicap.Checked Then
            deccost = deccost * 0.8
        End If

        decrunningtotal = decrunningtotal + deccost
 
You pass it by creating a subroutine, passing the variables on through and having the other form display them.


i.e.

'form 2
public sub Passthrough(dim i_var as Integer)
'display it somehow

end sub



'form 1

dim frm2 as new form2
frm2.show
frm2.passthrough(decrunningtotal)
 
Back
Top