Talismanic
Registered User.
- Local time
- Today, 02:30
- Joined
- May 25, 2000
- Messages
- 377
Well it didn't take very long for them to ask me to modify the output of the application. I thought I could figure it out but that was not the case, so I am back asking for more help.
In my previous Brain Teaser post I only needed to evaluate one text box with one output. Now I need to look at five text boxes and prodcuce 5 results. Since I am starting to get my mind around arrays I thought I could use Control Arrays, not the case with Access.
I know that I have to do something like this (found example on another post):
index = 0
For i = 1 to 10
if txtText(index) = whatever then
do something
end if
index = index + 1
next i
But I am not sure how to work that into this code. The 5 boxes that need to be evaluated are CodePick1, CodePick2, etc... and Answer1, Answer2 etc...
Dim myArray(8) As String
Dim i As Integer
Dim strEval As Integer
Dim OC(8) As String
Dim TempString As String
myArray(1) = " - 9th Hour Mon-Fri"
myArray(2) = " - 10th Hour Mon-Fri"
myArray(3) = " - Over 10 Hours"
myArray(4) = " - First 8 Hours Saturday"
myArray(5) = " - 9th hour Saturday"
myArray(6) = " - 10th Hour Saturday"
myArray(7) = " - Over 10 Hour Saturday"
myArray(8) = " - Any Hrs Sunday or Holiday"
For i = 1 To 8
OC(i) = Mid(CodePick, i, 1)
Select Case OC(i)
Case "H"
TempString = "Time & 1/2"
Case "B"
TempString = "Basic Hour Rate"
Case "X"
TempString = "Time & 1/2 Over 40"
Case "D"
TempString = "Double Time"
Case "T"
TempString = "Triple Time"
End Select
OC(i) = i & " = " & Mid(CodePick, i, 1) & myArray(i) & _
" - " & TempString
Next i
In my previous Brain Teaser post I only needed to evaluate one text box with one output. Now I need to look at five text boxes and prodcuce 5 results. Since I am starting to get my mind around arrays I thought I could use Control Arrays, not the case with Access.
I know that I have to do something like this (found example on another post):
index = 0
For i = 1 to 10
if txtText(index) = whatever then
do something
end if
index = index + 1
next i
But I am not sure how to work that into this code. The 5 boxes that need to be evaluated are CodePick1, CodePick2, etc... and Answer1, Answer2 etc...
Dim myArray(8) As String
Dim i As Integer
Dim strEval As Integer
Dim OC(8) As String
Dim TempString As String
myArray(1) = " - 9th Hour Mon-Fri"
myArray(2) = " - 10th Hour Mon-Fri"
myArray(3) = " - Over 10 Hours"
myArray(4) = " - First 8 Hours Saturday"
myArray(5) = " - 9th hour Saturday"
myArray(6) = " - 10th Hour Saturday"
myArray(7) = " - Over 10 Hour Saturday"
myArray(8) = " - Any Hrs Sunday or Holiday"
For i = 1 To 8
OC(i) = Mid(CodePick, i, 1)
Select Case OC(i)
Case "H"
TempString = "Time & 1/2"
Case "B"
TempString = "Basic Hour Rate"
Case "X"
TempString = "Time & 1/2 Over 40"
Case "D"
TempString = "Double Time"
Case "T"
TempString = "Triple Time"
End Select
OC(i) = i & " = " & Mid(CodePick, i, 1) & myArray(i) & _
" - " & TempString
Next i