Hello all,
Man I am not sure where to start. I have 8 textboxes that have to have numerical data entered into them. Nothing is done with the data until the user presses cmd_calcit. I need to check if the data is between 0.0 and 9.9 inclusive in the first 4 boxes and if the data is between 4 and 7 in the other 4 boxes. and if not it stays in that box until correct data entered.
the entry order is first set of boxes(1) second set of boxes(1) then wait 30 seconds and first set of boxes(2) then second set of boxes(2) then wait ......... and so on
The other problem, I am not real sure where in the module to insert the code . The processing takes place when cmd_calcit is pressed
If anyone can help I would realy appreciate it.
Psybertek
-----------------------------------------
"Computer junkies never die, They Just upload."
____________________________________________________________
Option Explicit
Dim hcread(4) As Double
Dim rateass(4) As Double
Dim negnum(4)
Dim decay As Double
Dim a
Dim Secs As Long
Private Sub cmd_calcit_Click()
Dim msg, style, title, help, ctxt, response
style = 0
help = ""
ctxt = 1000
hcread(1) = Text1.Text
negnum(1) = Text5.Text
hcread(2) = Text2.Text
negnum(2) = Text6.Text
hcread(3) = Text3.Text
negnum(3) = Text7.Text
hcread(4) = Text4.Text
negnum(4) = Text8.Text
For a = 1 To 4
title = "Invalid Entry "
msg = negnum(a)
Select Case negnum(a) 'this is to decide how to calculate the rate of assencion
Case 1 To 2: response = MsgBox(msg, style, title, help, ctxt)
Case 7: rateass(a) = hcread(a) / 10
Case 6: rateass(a) = hcread(a) * 1
Case 5: rateass(a) = hcread(a) * 10
Case 4: rateass(a) = hcread(a) * 100
Case 3: rateass(a) = hcread(a) * 1000
Case Is > 7: response = MsgBox(msg, style, title, help, ctxt)
End Select
Next a
Text9.Text = rateass(1)
Text10.Text = rateass(2)
Text11.Text = rateass(3)
Text12.Text = rateass(4)
decay = rateass(4) - rateass(2)
Text13.Text = decay
Clipboard.Clear
Clipboard.SetText Text13.Text
End Sub
Private Sub cmd_clr_Click() 'this routine clears all text boxes
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
End Sub
Private Sub cmd_start_Click()
Secs = 120
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub Form_Load()
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Label2_Click()
End Sub
Private Sub Label3_Click()
End Sub
Private Sub Label4_Click()
End Sub
Private Sub Label5_Click(Index As Integer)
End Sub
Private Sub Label6_Click(Index As Integer)
End Sub
Private Sub Label7_Click()
End Sub
Private Sub Label8_Click()
End Sub
Private Sub Label9_Click()
End Sub
Private Sub Text1_Change()
End Sub
Private Sub Text10_Change()
End Sub
Private Sub Text11_Change()
End Sub
Private Sub Text12_Change()
End Sub
Private Sub Text13_Change()
End Sub
Private Sub Text2_Change()
End Sub
Private Sub Text3_Change()
End Sub
Private Sub Text4_Change()
End Sub
Private Sub Text5_Change()
End Sub
Private Sub Text6_Change()
End Sub
Private Sub Text7_Change()
End Sub
Private Sub Text8_Change()
End Sub
Private Sub Text9_Change()
End Sub
Private Sub Timer1_Timer()
Label8 = Secs
Secs = Secs - 1
If Secs < 0 Then Timer1.Enabled = False
End Sub
Man I am not sure where to start. I have 8 textboxes that have to have numerical data entered into them. Nothing is done with the data until the user presses cmd_calcit. I need to check if the data is between 0.0 and 9.9 inclusive in the first 4 boxes and if the data is between 4 and 7 in the other 4 boxes. and if not it stays in that box until correct data entered.
the entry order is first set of boxes(1) second set of boxes(1) then wait 30 seconds and first set of boxes(2) then second set of boxes(2) then wait ......... and so on
The other problem, I am not real sure where in the module to insert the code . The processing takes place when cmd_calcit is pressed
If anyone can help I would realy appreciate it.
![[alien] [alien] [alien]](/data/assets/smilies/alien.gif)
![[alien] [alien] [alien]](/data/assets/smilies/alien.gif)
-----------------------------------------
"Computer junkies never die, They Just upload."
____________________________________________________________
Option Explicit
Dim hcread(4) As Double
Dim rateass(4) As Double
Dim negnum(4)
Dim decay As Double
Dim a
Dim Secs As Long
Private Sub cmd_calcit_Click()
Dim msg, style, title, help, ctxt, response
style = 0
help = ""
ctxt = 1000
hcread(1) = Text1.Text
negnum(1) = Text5.Text
hcread(2) = Text2.Text
negnum(2) = Text6.Text
hcread(3) = Text3.Text
negnum(3) = Text7.Text
hcread(4) = Text4.Text
negnum(4) = Text8.Text
For a = 1 To 4
title = "Invalid Entry "
msg = negnum(a)
Select Case negnum(a) 'this is to decide how to calculate the rate of assencion
Case 1 To 2: response = MsgBox(msg, style, title, help, ctxt)
Case 7: rateass(a) = hcread(a) / 10
Case 6: rateass(a) = hcread(a) * 1
Case 5: rateass(a) = hcread(a) * 10
Case 4: rateass(a) = hcread(a) * 100
Case 3: rateass(a) = hcread(a) * 1000
Case Is > 7: response = MsgBox(msg, style, title, help, ctxt)
End Select
Next a
Text9.Text = rateass(1)
Text10.Text = rateass(2)
Text11.Text = rateass(3)
Text12.Text = rateass(4)
decay = rateass(4) - rateass(2)
Text13.Text = decay
Clipboard.Clear
Clipboard.SetText Text13.Text
End Sub
Private Sub cmd_clr_Click() 'this routine clears all text boxes
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
End Sub
Private Sub cmd_start_Click()
Secs = 120
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub Form_Load()
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Label2_Click()
End Sub
Private Sub Label3_Click()
End Sub
Private Sub Label4_Click()
End Sub
Private Sub Label5_Click(Index As Integer)
End Sub
Private Sub Label6_Click(Index As Integer)
End Sub
Private Sub Label7_Click()
End Sub
Private Sub Label8_Click()
End Sub
Private Sub Label9_Click()
End Sub
Private Sub Text1_Change()
End Sub
Private Sub Text10_Change()
End Sub
Private Sub Text11_Change()
End Sub
Private Sub Text12_Change()
End Sub
Private Sub Text13_Change()
End Sub
Private Sub Text2_Change()
End Sub
Private Sub Text3_Change()
End Sub
Private Sub Text4_Change()
End Sub
Private Sub Text5_Change()
End Sub
Private Sub Text6_Change()
End Sub
Private Sub Text7_Change()
End Sub
Private Sub Text8_Change()
End Sub
Private Sub Text9_Change()
End Sub
Private Sub Timer1_Timer()
Label8 = Secs
Secs = Secs - 1
If Secs < 0 Then Timer1.Enabled = False
End Sub