Form code:
Code: Select all
Private Sub cmdCalculate_Click()
' If F=ma is selected...
If optMA.Value = True Then
lblReading.Caption = MACalc()
End If
' If F=m(v/t) is selected...
If optMVT.Value = True Then
lblReading.Captain = MVTCalc()
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Code: Select all
Public Sub MACalc()
m = Val(txtMass.Text)
a = Val(txtAcceleration.Text)
F = m * a
End Sub
Public Sub MVTCalc()
m = Val(txtMass.Text)
v = Val(txtVelocity.Text)
t = Val(txtTime.Text)
F = m * (v / t)
End Sub
Thanks much.
ADDITION: Whoops, I forgot to say that it points to the MACalc() and MVTCalc() commands within the form code.