Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kiral Demir   on Mar 09 In MS Office Category.

  
Question Answered By: Hollie Hughes   on Mar 09

thanks for the help so far. i'm trying to hide the dialogue box, but
i get a runtime error 402 - must close  or hide topmost modal form
first. i don't know how fix this.


Option Explicit

'dimensionalizing variables
Public A As Variant
Public HF As Variant
Public HI As Variant
Public BW As Variant
Public TCM As Variant
Public TCS As Variant
Public PeakVO2 As Variant
Public Treadmill As Boolean
Public Stairmill As Boolean
Public Maximal As Boolean
Public Submaximal As Boolean

Sub MaxVO2Predict()

'dimensionalizing variables
Dim MTInt As Single
Dim MTTC As Single
Dim MTBMI As Single
Dim MSInt As Single
Dim MSTC As Single
Dim MSBMI As Single
Dim ST208Int As Single
Dim ST208TC As Single
Dim ST208BMI As Single
Dim SS208Int As Single
Dim SS208TC As Single
Dim SS208BMI As Single
Dim VO2Input As Object
Dim n As Long

'input prediction equation  coefficients from appropriate cells
MTInt = Sheets("Equations").Cells(8, 14)
MTTC = Sheets("Equations").Cells(9, 14)
MTBMI = Sheets("Equations").Cells(10, 14)
MSInt = Sheets("Equations").Cells(8, 17)
MSTC = Sheets("Equations").Cells(9, 17)
MSBMI = Sheets("Equations").Cells(10, 17)
ST208Int = Sheets("Equations").Cells(15, 4)
ST208TC = Sheets("Equations").Cells(16, 4)
ST208BMI = Sheets("Equations").Cells(17, 4)
SS208Int = Sheets("Equations").Cells(15, 7)
SS208TC = Sheets("Equations").Cells(16, 7)
SS208BMI = Sheets("Equations").Cells(17, 7)

Set VO2Input = New VO2Input
VO2Input.Show

If Treadmill = True And Maximal = True Then
PeakVO2 = MSInt + ((TCM + (TCS / 60)) * MSTC) + ((BW * 0.453592) /
((((HF * 12) + HI) * 0.0254) ^ 2) * MSBMI)
ElseIf Stairmill = True And Maximal = True Then
PeakVO2 = MTInt + ((TCM + (TCS / 60)) * MTTC) + ((BW * 0.453592) /
((((HF * 12) + HI) * 0.0254) ^ 2) * MTBMI)
ElseIf Treadmill = True And Submaximal = True Then
PeakVO2 = ST208Int + ((TCM + (TCS / 60)) * ST208TC) + ((BW *
0.453592) / ((((HF * 12) + HI) * 0.0254) ^ 2) * ST208BMI)
ElseIf Stairmill = True And Submaximal = True Then
PeakVO2 = SS208Int + ((TCM + (TCS / 60)) * SS208TC) + ((BW *
0.453592) / ((((HF * 12) + HI) * 0.0254) ^ 2) * SS208BMI)
End If

'score is diplayed in appropriate cell
Cells(14, 3) = PeakVO2

n = Sheets("Equations").Cells(19, 14)

'output data from subject into database
Sheets("Data").Cells(2 + n, 1) = (n + 1)
Sheets("Data").Cells(2 + n, 2) = A
Sheets("Data").Cells(2 + n, 3) = (HF * 12) + HI
Sheets("Data").Cells(2 + n, 4) = ((HF * 12) + HI) * 2.54
Sheets("Data").Cells(2 + n, 5) = BW
Sheets("Data").Cells(2 + n, 6) = BW * 0.453592
Sheets("Data").Cells(2 + n, 7) = (BW * 0.453592) / ((((HF * 12) + HI)
* 0.0254) ^ 2)
Sheets("Data").Cells(2 + n, 8) = TCM + (TCS / 60)
Sheets("Data").Cells(2 + n, 9) = PeakVO2
If Stairmill = True Then
Sheets("Data").Cells(2 + n, 10) = "Stairmill"
ElseIf Treadmill = True Then
Sheets("Data").Cells(2 + n, 10) = "Treadmill"
End If
If Maximal = True Then
Sheets("Data").Cells(2 + n, 11) = "Maximal"
ElseIf Submaximal = True Then
Sheets("Data").Cells(2 + n, 11) = "Submaximal"
End If

Unload VO2Input

End Sub



Option Explicit

Private Sub Enter_Click()

MaxVO2Predict.A = InputAge.Value
MaxVO2Predict.HF = InputHeightFeet.Value
MaxVO2Predict.HI = InputHeightInches.Value
MaxVO2Predict.BW = InputWeight.Value
MaxVO2Predict.TCM = InputTestTimeMin.Value
MaxVO2Predict.TCS = InputTestTimeSeconds.Value
MaxVO2Predict.Treadmill = Tread.Value
MaxVO2Predict.Stairmill = Stair.Value
MaxVO2Predict.Maximal = Max.Value
MaxVO2Predict.Submaximal = Submax.Value

VO2Input.Hide

End Sub

Private Sub Quit_Click()

Unload VO2Input
End

End Sub

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on custom dialogue box variable entry trouble Or get search suggestion and latest updates.


Tagged: