Runtime Error '9' Subscript Out Of Range/Time Program
Sorry for the length this will be, but I can't get where this is coming from... The line the error shows on is marked with ---------->. (Or just search for 700) It's the line after where I specified I wanted it to extend from 0-700 (weeks). It works fine if I make i = 0 to 500, but if I make it anything but 500, it ends. I'm trying to extend the length of my time program. If possible, could you explain why this is happening?
Private Sub MAKEHTM()
Dim FNAME$, s1$, s2$, s3$, S4$, R1#, RALL#
jobnamect = 1:
jmatchon = 0
Open "C:TMP.HTM" For Output As #1
Print #1, "<HTML><HEAD><TITLE></TITLE></HEAD><BR>"
Print #1, "<BLOCKQUOTE><B><PRE><CENTER>"
Print #1, "<FONT SIZE=+3><I>WEEKLY TIME SHEET</I></FONT>"
Print #1, "WEEK ENDING:<U> " & CVDate(WEEK2) & " </U> NAME:<U> " & Label8.Caption & " </U> EMP#:<U> " & Label9.Caption & " </U>"
RALL = 0
jobnamect = 0
For i = 0 To 299: jobnamearry(i) = "": jobotary(i) = 0: jobtimearry(i) = 0: Next i
For i1 = 0 To 6
If i1 = 0 Then LCT = L1CT
If i1 = 1 Then LCT = L2CT
If i1 = 2 Then LCT = L3CT
If i1 = 3 Then LCT = L4CT
If i1 = 4 Then LCT = L5CT
If i1 = 5 Then LCT = L6CT
If i1 = 6 Then LCT = L7CT
For i = 0 To LCT - 1
If i1 = 0 Then s2 = L11(i): s3 = L12(i): S4 = L13(i)
If i1 = 1 Then s2 = L21(i): s3 = L22(i): S4 = L23(i)
If i1 = 2 Then s2 = L31(i): s3 = L32(i): S4 = L33(i)
If i1 = 3 Then s2 = L41(i): s3 = L42(i): S4 = L43(i)
If i1 = 4 Then s2 = L51(i): s3 = L52(i): S4 = L53(i)
If i1 = 5 Then s2 = L61(i): s3 = L62(i): S4 = L63(i)
If i1 = 6 Then s2 = L71(i): s3 = L72(i): S4 = L73(i)
R1 = CDbl(s2) + CDbl(s3)
jmatch = 0:
If jmatchon = 0 Then jobnamearry(1) = S4: jmatchon = 1
For i2 = 1 To jobnamect
If LTrim(RTrim(S4)) = LTrim(RTrim(jobnamearry(i2))) Then
jmatch = 1
jobtimearry(i2) = jobtimearry(i2) + R1
End If
Next i2
' jmatch = 0
If jmatch = 0 Then
jobnamect = jobnamect + 1
jobnamearry(jobnamect) = S4
jobtimearry(jobnamect) = jobtimearry(jobnamect) + R1
End If
RALL = RALL + R1
Next i
Next i1
Print #1, ""
For i2 = 1 To jobnamect
s1 = jobnamearry(i2): s2 = jobtimearry(i2)
Print #1, "JOB:<U> " & s1 & " ( " & s2 & " ) "
Next i2
Print #1, ""
s2 = "0.00"
s3 = "40.00"
s1 = CStr((CLng(RALL * 100) / 100#))
If RALL > 40 Then s2 = CStr((CLng((RALL - 40) * 100) / 100#))
If RALL <= 40 Then s3 = CStr((CLng(RALL * 100) / 100#))
Print #1, "TOTAL HOURS:<U> " & Space(10 - Len(s1)) & s1 & " </U> OT:<U> " & Space(10 - Len(s2)) & s2 & " </U> NT:<U> " & Space(10 - Len(s3)) & s3 & " </U>"
Print #1, "</PRE></FONT></B></BLOCKQUOTE></CENTER><HR>"
For i1 = 0 To 6
If i1 = 0 Then LCT = L1CT
If i1 = 1 Then LCT = L2CT
If i1 = 2 Then LCT = L3CT
If i1 = 3 Then LCT = L4CT
If i1 = 4 Then LCT = L5CT
If i1 = 5 Then LCT = L6CT
If i1 = 6 Then LCT = L7CT
RALL = 0
For i = 0 To LCT - 1
If i1 = 0 Then s1 = L13(i): s2 = L11(i): s3 = L12(i)
If i1 = 1 Then s1 = L23(i): s2 = L21(i): s3 = L22(i)
If i1 = 2 Then s1 = L33(i): s2 = L31(i): s3 = L32(i)
If i1 = 3 Then s1 = L43(i): s2 = L41(i): s3 = L42(i)
If i1 = 4 Then s1 = L53(i): s2 = L51(i): s3 = L52(i)
If i1 = 5 Then s1 = L63(i): s2 = L61(i): s3 = L62(i)
If i1 = 6 Then s1 = L73(i): s2 = L71(i): s3 = L72(i)
R1 = CDbl(s2) + CDbl(s3)
RALL = RALL + R1
Next i
If RALL > 0 Then
Print #1, "<BLOCKQUOTE><B><FONT SIZE=1><PRE>"
s1 = CStr((CLng(RALL * 100) / 100#))
s2 = Format(CVDate(WEEK2 - 6 + i1), "DDDD")
'& Space((10 - Len(S2)) * 2)
Label1.Caption = s2 & " : " & s1
Print #1, "<FONT SIZE=+1>" & s2 & " : <U>" & Space(6 - Len(s1)) & s1 & " </U>" & " HOURS : " ' & CVDate(WEEK2 - 6 + i1) & "</FONT>"
For i = 0 To LCT - 1
If i1 = 0 Then s1 = L13(i): s2 = L11(i): s3 = L12(i): S4 = L15(i)
If i1 = 1 Then s1 = L23(i): s2 = L21(i): s3 = L22(i): S4 = L25(i)
If i1 = 2 Then s1 = L33(i): s2 = L31(i): s3 = L32(i): S4 = L35(i)
If i1 = 3 Then s1 = L43(i): s2 = L41(i): s3 = L42(i): S4 = L45(i)
If i1 = 4 Then s1 = L53(i): s2 = L51(i): s3 = L52(i): S4 = L55(i)
If i1 = 5 Then s1 = L63(i): s2 = L61(i): s3 = L62(i): S4 = L65(i)
If i1 = 6 Then s1 = L73(i): s2 = L71(i): s3 = L72(i): S4 = L75(i)
s1 = Left(RTrim(LTrim(s1)), 29)
s2 = RTrim(LTrim(s2))
s3 = RTrim(LTrim(s3))
Label1.Caption = s1 & ":" & s2 & ":" & s3
Print #1, " JOB:<U> " & Space(30 - Len(s1)) & s1 & " </U> OT:<U> " & Space(10 - Len(s2)) & s2 & " </U> NT:<U> " & Space(10 - Len(s3)) & s3 & " </U>"
Print #1, " " & S4
Next i
Print #1, "</PRE></FONT></B></BLOCKQUOTE><HR>"
End If
Next i1
Close #1
End Sub
Private Sub STDGET()
s1 = Dir("C:TIMEinfo.STD", 0)
If s1 <> "" Then
Open "C:TIMEinfo.STD" For Input As #9:
Input #9, drv1
Input #9, s1: WEEK2 = CDbl(s1)
EMPCT = 0
Do While Not EOF(9)
Input #9, NAME1(EMPCT): Input #9, EMP1(EMPCT)
EMPCT = EMPCT + 1
Loop
Label8.Caption = NAME1(0): Label9.Caption = EMP1(0)
FDATA = drv1 & ":TIME" & EMP1(0) & ""
Close #9
End If
End Sub
Private Sub bclr()
Command3.FontBold = False: Command4.FontBold = False: Command5.FontBold = False: Command6.FontBold = False: Command7.FontBold = False: Command8.FontBold = False: Command9.FontBold = False:
End Sub
Private Sub Combo1_Click()
Dim i1%, i2%
i2 = Combo1.ListIndex
LSTJOBDWG
i1 = List2.ListIndex
If i1 >= 0 Then
If i2 >= 0 Then Text3.Text = JOB(i2)
End If
End Sub
Private Sub Combo2_Click()
Dim i1%, i2%
i2 = Combo2.ListIndex
LSTJOBDWG
i1 = List2.ListIndex
If i1 >= 0 Then
If i2 >= 0 Then Text4.Text = DWG(i2)
End If
End Sub
Private Sub Command1_Click()
If BCT = 1 Then L11(L1CT) = "0": L12(L1CT) = "0": L13(L1CT) = "JOB": L14(L1CT) = "DWG": L15(L1CT) = "DESC": L16(L1CT) = 0: L1CT = L1CT + 1: L2UPD 0
If BCT = 2 Then L21(L2CT) = "0": L22(L2CT) = "0": L23(L2CT) = "JOB": L24(L1CT) = "DWG": L25(L2CT) = "DESC": L26(L2CT) = 0: L2CT = L2CT + 1: L2UPD 0
If BCT = 3 Then L31(L3CT) = "0": L32(L3CT) = "0": L33(L3CT) = "JOB": L34(L1CT) = "DWG": L35(L3CT) = "DESC": L36(L3CT) = 0: L3CT = L3CT + 1: L2UPD 0
If BCT = 4 Then L41(L4CT) = "0": L42(L4CT) = "0": L43(L4CT) = "JOB": L44(L1CT) = "DWG": L45(L4CT) = "DESC": L46(L4CT) = 0: L4CT = L4CT + 1: L2UPD 0
If BCT = 5 Then L51(L5CT) = "0": L52(L5CT) = "0": L53(L5CT) = "JOB": L54(L1CT) = "DWG": L55(L5CT) = "DESC": L56(L5CT) = 0: L5CT = L5CT + 1: L2UPD 0
If BCT = 6 Then L61(L6CT) = "0": L62(L6CT) = "0": L63(L6CT) = "JOB": L64(L1CT) = "DWG": L65(L6CT) = "DESC": L66(L6CT) = 0: L6CT = L6CT + 1: L2UPD 0
If BCT = 7 Then L71(L7CT) = "0": L72(L7CT) = "0": L73(L7CT) = "JOB": L74(L1CT) = "DWG": L75(L7CT) = "DESC": L76(L7CT) = 0: L7CT = L7CT + 1: L2UPD 0
End Sub
Private Sub Command10_Click()
FILEWR
End Sub
Private Sub Command11_Click()
Dim i1%, i2%, i%
i = List2.ListIndex
If i >= 0 Then
If BCT = 1 Then
If L1CT > 0 Then
For i2 = 0 To L1CT + 10: L81(i2) = L11(i2): L82(i2) = L12(i2): L83(i2) = L13(i2): L84(i2) = L14(i2): L85(i2) = L15(i2): Next i2
i1 = 0
For i2 = 0 To L1CT + 10: L11(i1) = L81(i2): L12(i1) = L82(i2): L13(i1) = L83(i2): L14(i1) = L84(i2): L15(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L1CT = L1CT - 1: If i >= L1CT Then i = 0
End If
End If
If BCT = 2 Then
If L2CT > 0 Then
For i2 = 0 To L2CT + 10: L81(i2) = L21(i2): L82(i2) = L22(i2): L83(i2) = L23(i2): L84(i2) = L24(i2): L85(i2) = L25(i2): Next i2
i1 = 0
For i2 = 0 To L2CT + 10: L21(i1) = L81(i2): L22(i1) = L82(i2): L23(i1) = L83(i2): L24(i1) = L84(i2): L25(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L2CT = L2CT - 1: If i >= L2CT Then i = 0
End If
End If
If BCT = 3 Then
If L3CT > 0 Then
For i2 = 0 To L3CT + 10: L81(i2) = L31(i2): L82(i2) = L32(i2): L83(i2) = L33(i2): L84(i2) = L34(i2): L85(i2) = L35(i2): Next i2
i1 = 0
For i2 = 0 To L3CT + 10: L31(i1) = L81(i2): L32(i1) = L82(i2): L33(i1) = L83(i2): L34(i1) = L84(i2): L35(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L3CT = L3CT - 1: If i >= L3CT Then i = 0
End If
End If
If BCT = 4 Then
If L4CT > 0 Then
For i2 = 0 To L4CT + 10: L81(i2) = L41(i2): L82(i2) = L42(i2): L83(i2) = L43(i2): L84(i2) = L44(i2): L85(i2) = L45(i2): Next i2
i1 = 0
For i2 = 0 To L4CT + 10: L41(i1) = L81(i2): L42(i1) = L82(i2): L43(i1) = L83(i2): L44(i1) = L84(i2): L45(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L4CT = L4CT - 1: If i >= L4CT Then i = 0
End If
End If
If BCT = 5 Then
If L5CT > 0 Then
For i2 = 0 To L5CT + 10: L81(i2) = L51(i2): L82(i2) = L52(i2): L83(i2) = L53(i2): L84(i2) = L54(i2): L85(i2) = L55(i2): Next i2
i1 = 0
For i2 = 0 To L5CT + 10: L51(i1) = L81(i2): L52(i1) = L82(i2): L53(i1) = L83(i2): L54(i1) = L84(i2): L55(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L5CT = L5CT - 1: If i >= L5CT Then i = 0
End If
End If
If BCT = 6 Then
If L6CT > 0 Then
For i2 = 0 To L6CT + 10: L81(i2) = L61(i2): L82(i2) = L62(i2): L83(i2) = L63(i2): L84(i2) = L64(i2): L85(i2) = L65(i2): Next i2
i1 = 0
For i2 = 0 To L6CT + 10: L61(i1) = L81(i2): L62(i1) = L82(i2): L63(i1) = L83(i2): L64(i1) = L84(i2): L65(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L6CT = L6CT - 1: If i >= L6CT Then i = 0
End If
End If
If BCT = 7 Then
If L7CT > 0 Then
For i2 = 0 To L7CT + 10: L81(i2) = L71(i2): L82(i2) = L72(i2): L83(i2) = L73(i2): L84(i2) = L74(i2): L85(i2) = L75(i2): Next i2
i1 = 0
For i2 = 0 To L7CT + 10: L71(i1) = L81(i2): L72(i1) = L82(i2): L73(i1) = L83(i2): L74(i1) = L84(i2): L75(i1) = L85(i2):
If i2 <> i Then i1 = i1 + 1
Next i2
L7CT = L7CT - 1: If i >= L7CT Then i = 0
End If
End If
L2UPD i
' List2.ListIndex = i
End If
End Sub
Private Sub Command12_Click()
Dim OPT%
s2 = "C:TEMPFILE.OPT": s1 = Dir(s2, ATTR_FILE): If s1 <> "" Then Kill (s2)
s1 = drv1 & ":TIMEFTIME.BAT": X = Shell(s1, 6)
OPT = 0
Do While OPT = 0
For i = 0 To 100: For i1 = 0 To 100: Next i1: Next i
s1 = Dir(s2, ATTR_FILE)
If s1 <> "" Then OPT = 1
Loop
Load TIME1
TIME1.Show
End Sub
Private Sub Command2_Click()
FILEWR
MAKEHTM
s3 = "C: mp.htm":
OLE1.Visible = True:
OLE1.SourceItem = s3:
OLE1.SourceDoc = s3:
OLE1.Action = 1
OLE1.Action = 7
End Sub
Private Sub Command3_Click()
BCT = 1: bclr: Command3.FontBold = True: L2UPD 0
End Sub
Private Sub Command4_Click()
BCT = 2: bclr: Command4.FontBold = True: L2UPD 0
End Sub
Private Sub Command5_Click()
BCT = 3: bclr: Command5.FontBold = True: L2UPD 0
End Sub
Private Sub Command6_Click()
BCT = 4: bclr: Command6.FontBold = True: L2UPD 0
End Sub
Private Sub Command7_Click()
BCT = 5: bclr: Command7.FontBold = True: L2UPD 0
End Sub
Private Sub Command8_Click()
BCT = 6: bclr: Command8.FontBold = True: L2UPD 0
End Sub
Private Sub Command9_Click()
BCT = 7: bclr: Command9.FontBold = True: L2UPD 0
End Sub
Private Sub FILEREAD(FN$)
Dim s1$, s2$, s3$, S4$, S10$
Open FN For Input As #9:
L1CT = 0: L2CT = 0: L3CT = 0: L4CT = 0: L5CT = 0: L6CT = 0: L7CT = 0:
S10 = strout()
Do While Left(S10, 1) = "^"
If Left(S10, 2) = "^1" Then L11(L1CT) = strout(): L12(L1CT) = strout(): L13(L1CT) = strout(): L14(L1CT) = strout(): L15(L1CT) = strout(): S10 = strout(): L1CT = L1CT + 1
If Left(S10, 2) = "^2" Then L21(L2CT) = strout(): L22(L2CT) = strout(): L23(L2CT) = strout(): L24(L2CT) = strout(): L25(L2CT) = strout(): S10 = strout(): L2CT = L2CT + 1
If Left(S10, 2) = "^3" Then L31(L3CT) = strout(): L32(L3CT) = strout(): L33(L3CT) = strout(): L34(L3CT) = strout(): L35(L3CT) = strout(): S10 = strout(): L3CT = L3CT + 1
If Left(S10, 2) = "^4" Then L41(L4CT) = strout(): L42(L4CT) = strout(): L43(L4CT) = strout(): L44(L4CT) = strout(): L45(L4CT) = strout(): S10 = strout(): L4CT = L4CT + 1
If Left(S10, 2) = "^5" Then L51(L5CT) = strout(): L52(L5CT) = strout(): L53(L5CT) = strout(): L54(L5CT) = strout(): L55(L5CT) = strout(): S10 = strout(): L5CT = L5CT + 1
If Left(S10, 2) = "^6" Then L61(L6CT) = strout(): L62(L6CT) = strout(): L63(L6CT) = strout(): L64(L6CT) = strout(): L65(L6CT) = strout(): S10 = strout(): L6CT = L6CT + 1
If Left(S10, 2) = "^7" Then L71(L7CT) = strout(): L72(L7CT) = strout(): L73(L7CT) = strout(): L74(L7CT) = strout(): L75(L7CT) = strout(): S10 = strout(): L7CT = L7CT + 1
Loop
Close #9
End Sub
Private Sub FILEWR()
Open FN1 For Output As #1
For i = 0 To L1CT - 1: Print #1, "^1": Print #1, L11(i): Print #1, L12(i): Print #1, L13(i): Print #1, L14(i): Print #1, L15(i): Next i
For i = 0 To L2CT - 1: Print #1, "^2": Print #1, L21(i): Print #1, L22(i): Print #1, L23(i): Print #1, L24(i): Print #1, L25(i): Next i
For i = 0 To L3CT - 1: Print #1, "^3": Print #1, L31(i): Print #1, L32(i): Print #1, L33(i): Print #1, L34(i): Print #1, L35(i): Next i
For i = 0 To L4CT - 1: Print #1, "^4": Print #1, L41(i): Print #1, L42(i): Print #1, L43(i): Print #1, L44(i): Print #1, L45(i): Next i
For i = 0 To L5CT - 1: Print #1, "^5": Print #1, L51(i): Print #1, L52(i): Print #1, L53(i): Print #1, L54(i): Print #1, L55(i): Next i
For i = 0 To L6CT - 1: Print #1, "^6": Print #1, L61(i): Print #1, L62(i): Print #1, L63(i): Print #1, L64(i): Print #1, L65(i): Next i
For i = 0 To L7CT - 1: Print #1, "^7": Print #1, L71(i): Print #1, L72(i): Print #1, L73(i): Print #1, L74(i): Print #1, L75(i): Next i
Print #1, "~":
Close #1
End Sub
'
Private Sub Form_Load()
Dim i%, s1$, s2$, s3$, S4$, S5$, S10$
drv1 = "H"
RUN = 0: L1CT = 0
STDGET
WEEK1 = WEEK2
For i = 0 To EMPCT: List3.AddItem NAME1(i): Next i
If EMPCT < 2 Then List3.Visible = False
If EMPCT < 2 Then Command12.Visible = False
For i = 0 To 700 '300 '240
-----------> WEEK(i) = CVDate(WEEK1)<---------------
S5 = WEEK(i) '& Space(20)
' S5 = Space((9 - Len(S5)) * 2) & S5 & " "
List1.AddItem S5
WEEK1 = WEEK1 + 7
Next i
WEEK1 = WEEK2
' i1 = List1.ListIndex
' WEEK2 = WEEK1 + (i1 * 7)
R1 = CLng(Date): R1 = R1 - WEEK1: R1 = R1 / 7: R1 = CLng(R1)
List1.ListIndex = R1
LSTJOBDWG
' ' CREATE LISTS
' Dim OPT%
' S2 = "C:TEMPFILE.OPT": S1 = Dir(S2, ATTR_FILE): If S1 <> "" Then Kill (S2)
' S1 = drv1 & ":TIMETIMEFTIME.BAT": X = Shell(S1, 6)
' OPT = 0
' Do While OPT = 0
' For i = 0 To 100: For i1 = 0 To 100: Next i1: Next i
' S1 = Dir(S2, ATTR_FILE)
' If S1 <> "" Then OPT = 1
' Loop
End Sub
Private Sub ITEMCLR()
Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = "": Text5.Text = "":
End Sub
Private Sub L2UPD(LCT%)
List2.Clear
If BCT = 1 Then
If L1CT > 0 Then
For i = 0 To L1CT - 1: List2.AddItem L13(i) & " : " & L15(i): Next i: If L1CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
If BCT = 2 Then
If L2CT > 0 Then
For i = 0 To L2CT - 1: List2.AddItem L23(i) & " : " & L25(i): Next i: If L2CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
If BCT = 3 Then
If L3CT > 0 Then
For i = 0 To L3CT - 1: List2.AddItem L33(i) & " : " & L35(i): Next i: If L3CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
If BCT = 4 Then
If L4CT > 0 Then
For i = 0 To L4CT - 1: List2.AddItem L43(i) & " : " & L45(i): Next i: If L4CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
If BCT = 5 Then
If L5CT > 0 Then
For i = 0 To L5CT - 1: List2.AddItem L53(i) & " : " & L55(i): Next i: If L5CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
If BCT = 6 Then
If L6CT > 0 Then
For i = 0 To L6CT - 1: List2.AddItem L63(i) & " : " & L65(i): Next i: If L6CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
If BCT = 7 Then
If L7CT > 0 Then
For i = 0 To L7CT - 1: List2.AddItem L73(i) & " : " & L75(i): Next i: If L7CT > 0 Then List2.ListIndex = LCT
Else
ITEMCLR
End If
End If
End Sub
Private Sub List1_Click()
Frame1.Visible = True
L1CT = 0: L2CT = 0: L3CT = 0: L4CT = 0: L5CT = 0: L6CT = 0: L7CT = 0:
List2.Clear
Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = "": Text5.Text = "":
i1 = List1.ListIndex
WEEK2 = WEEK1 + (i1 * 7)
FN1 = FDATA & "ts" & i1 & ".Txt"
' label1.Caption = FN1
'''''
s1 = Dir(FN1, vbNormal)
If s1 = "" Then Open FN1 For Output As #1: Print #1, "": Close #1
FILEREAD FN1
BCT = 1: bclr: Command3.FontBold = True: L2UPD 0
Command3.Caption = Format(CVDate(WEEK2 - 6), "DDD") & " : " & CVDate(WEEK2 - 6)
Command4.Caption = Format(CVDate(WEEK2 - 5), "DDD") & " : " & CVDate(WEEK2 - 5)
Command5.Caption = Format(CVDate(WEEK2 - 4), "DDD") & " : " & CVDate(WEEK2 - 4)
Command6.Caption = Format(CVDate(WEEK2 - 3), "DDD") & " : " & CVDate(WEEK2 - 3)
Command7.Caption = Format(CVDate(WEEK2 - 2), "DDD") & " : " & CVDate(WEEK2 - 2)
Command8.Caption = Format(CVDate(WEEK2 - 1), "DDD") & " : " & CVDate(WEEK2 - 1)
Command9.Caption = Format(CVDate(WEEK2), "DDD") & " : " & CVDate(WEEK2)
' ITEMCLR
End Sub
Private Sub List2_Click()
RUN = 1
LOP = 0: i1 = List2.ListIndex:
If BCT = 1 Then s1 = L11(i1): s2 = L12(i1): s3 = L13(i1): S4 = L14(i1): S5 = L15(i1)
If BCT = 2 Then s1 = L21(i1): s2 = L22(i1): s3 = L23(i1): S4 = L24(i1): S5 = L25(i1)
If BCT = 3 Then s1 = L31(i1): s2 = L32(i1): s3 = L33(i1): S4 = L34(i1): S5 = L35(i1)
If BCT = 4 Then s1 = L41(i1): s2 = L42(i1): s3 = L43(i1): S4 = L44(i1): S5 = L45(i1)
If BCT = 5 Then s1 = L51(i1): s2 = L52(i1): s3 = L53(i1): S4 = L54(i1): S5 = L55(i1)
If BCT = 6 Then s1 = L61(i1): s2 = L62(i1): s3 = L63(i1): S4 = L64(i1): S5 = L65(i1)
If BCT = 7 Then s1 = L71(i1): s2 = L72(i1): s3 = L73(i1): S4 = L74(i1): S5 = L75(i1)
Text1.Text = s1: Text2.Text = s2: Text3.Text = s3: Text4.Text = S4: Text5.Text = S5:
LOP = 1
End Sub
Private Sub List3_Click()
i = List3.ListIndex
If i >= 0 Then
Label8.Caption = NAME1(i): Label9.Caption = EMP1(i)
FDATA = drv1 & ":TIME" & EMP1(i) & ""
'' List1.ListIndex = 1
R1 = CLng(Date): R1 = R1 - WEEK1: R1 = R1 / 7: R1 = CLng(R1)
List1.ListIndex = R1
List1_Click
End If
End Sub
Private Sub LSTJOBDWG()
Dim i1%, i2%
Combo1.Clear: Combo2.Clear
' READ FROM OUTSIDE DATA FILE FOR JOB
s2 = "C:TIME" & "job.STD": s1 = Dir(s2, 0)
If s1 <> "" Then
Open s2 For Input As #9: JOBCT = 1
JOB(0) = " "
Do While Not EOF(9)
JOB(JOBCT) = strout(): If RTrim(LTrim(JOB(JOBCT))) <> "" Then JOBCT = JOBCT + 1
Loop
Close #9
End If
For i = 0 To JOBCT - 1: Combo1.AddItem JOB(i): Next i
' READ FROM OUTSIDE DATA FILE FOR DWG
s2 = "C:TIME" & "DWG.STD": s1 = Dir(s2, 0)
If s1 <> "" Then
Open s2 For Input As #9: DWGCT = 1
DWG(0) = " "
Do While Not EOF(9)
DWG(DWGCT) = strout(): If RTrim(LTrim(DWG(DWGCT))) <> "" Then DWGCT = DWGCT + 1
Loop
Close #9
End If
For i = 0 To DWGCT - 1: Combo2.AddItem DWG(i): Next i
End Sub
Private Sub LSTUPD()
Dim i1%
If LOP = 1 Then
i1 = List2.ListIndex
If BCT = 1 Then If i1 >= 0 Then L11(i1) = Text1.Text: L12(i1) = Text2.Text: L13(i1) = Text3.Text: L14(i1) = Text4.Text: L15(i1) = Text5.Text
If BCT = 2 Then If i1 >= 0 Then L21(i1) = Text1.Text: L22(i1) = Text2.Text: L23(i1) = Text3.Text: L24(i1) = Text4.Text: L25(i1) = Text5.Text
If BCT = 3 Then If i1 >= 0 Then L31(i1) = Text1.Text: L32(i1) = Text2.Text: L33(i1) = Text3.Text: L34(i1) = Text4.Text: L35(i1) = Text5.Text
If BCT = 4 Then If i1 >= 0 Then L41(i1) = Text1.Text: L42(i1) = Text2.Text: L43(i1) = Text3.Text: L44(i1) = Text4.Text: L45(i1) = Text5.Text
If BCT = 5 Then If i1 >= 0 Then L51(i1) = Text1.Text: L52(i1) = Text2.Text: L53(i1) = Text3.Text: L54(i1) = Text4.Text: L55(i1) = Text5.Text
If BCT = 6 Then If i1 >= 0 Then L61(i1) = Text1.Text: L62(i1) = Text2.Text: L63(i1) = Text3.Text: L64(i1) = Text4.Text: L65(i1) = Text5.Text
If BCT = 7 Then If i1 >= 0 Then L71(i1) = Text1.Text: L72(i1) = Text2.Text: L73(i1) = Text3.Text: L74(i1) = Text4.Text: L75(i1) = Text5.Text
' LST5(i1) = CDbl(LST1(i1)) * CDbl(LST2(i1))
L2UPD i1
' List2.ListIndex = i1
End If
End Sub
Private Function strout() As String
If Not EOF(9) Then
TEXTDATA = "": Char = Input(1, #9):
While Char <> Chr(10):
TEXTDATA = TEXTDATA & Char:
Char = Input(1, #9):
Wend:
strout = Left(TEXTDATA, Len(TEXTDATA) - 1)
End If
End Function
Private Sub Text1_Change()
If RUN > 0 Then LSTUPD
End Sub
Private Sub Text2_Change()
If RUN > 0 Then LSTUPD
End Sub
Private Sub Text3_Change()
If RUN > 0 Then LSTUPD
End Sub
Private Sub Text4_Change()
If RUN > 0 Then LSTUPD
End Sub
Private Sub Text5_Change()
If RUN > 0 Then LSTUPD
End Sub