Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How does the ExecuteChain and Execute MSO Work?

Status
Not open for further replies.

dianne001

Programmer
Mar 1, 2002
38
US
I am writting a vb application that is using the Ellipse BOC. This VB app is to allow users to retrieve, create, modify and delete employee roster transactions(mso89a, mso89b) and labor costing transactions(mso850). The problems that I am having is understanding the execute chain and execute mso. Since there aren't any MSQ screens for the payroll module, I need to use the MSO's (with out them displaying.)

I have figured out to to retrieve the first page of the mso89b screen for an employee but how do I get the second page? When I go directly into the ellipse application and to mso891 option 2 employee id ??? click ok and then I get the mso89b screen with the one page. the records are not processed and when I click ok I get cycled through the mso850 for each unprocessed transaction then finally I get the second page of mso89b.

Can anyone explain how the executechain and execute mso work? with paging? etc.
thanks,
dk
 
Hi Dianne,

Noticed that you sort of answering your own quetions, they must be quite hard as no one answered, so for the benefit of others that might have struggled with the original question, I was wandering if you can spare a minute to give an idea of the solution you found
Thanks
 
Calator,
I went to the online screen via the ellipse application and documented from the start what I did.
for example I wanted to retrieve the employee time records to display on a vb screen.
so in the online screen MSO89T I selected option 1 and entered the employee id and clicked OK. I was taken to the MSO89C screen. and every time I clicked OK I was taken to the next page. until the message at the bottom of the screen says Page 005/005. (There was 5 pages of time records for this employee). Now this time when I press enter I am taken back to the MSO89T.

In my code I had to execute the mso screen MSO89T and fill in the option field and employee id. and execute the OK command. then you a sitting on the MSO89C with the information for employee. I had to run a loop, checking each occurence on the screen to load up my flex grid with the information from the MSO89T. I also had to do splitting up of time fields to accumulate for regular time verses overtime. when I was done with the seventh occurence on the screen I had to execute the OK command and then check to see where I landed. If I landed on the screen name MSM89TA I knew I had returned to the MSO89T and was done. There is a lot of code here. I am new to vb 6 so it may not be as effecient or pretty as other code.



My code looks like this:
Myform.gobjMIMS.Screen.ExecuteMSO ("MSO89T")
Myform.gobjMIMS.Screen.MSO.Fields("OPTION1I") = "1"
Myform.gobjMIMS.Screen.MSO.Fields("EMP_ID1I") = sEmployeeId
Myform.gobjMIMS.Screen.MSO.Commands("OK").Execute
If Trim(Myform.gobjMIMS.Screen.MSO.Error) <> &quot;&quot; Then
strErrorMessage = Trim(Myform.gobjMIMS.Screen.MSO.Error)
Myform.gobjMIMS.Screen.MSO.Commands(&quot;Cancel&quot;).Execute
Myform.gobjMIMS.Screen.MSO.Commands(&quot;Home&quot;).Execute
Exit Function
End If


For int3 = 1 To 299
strSkillDisplay = Myform.gobjMIMS.Screen.MSO.Fields(&quot;SKLDISPLAY1I&quot;)
strEmployeeId = Myform.gobjMIMS.Screen.MSO.Fields(&quot;EMP_ID1I&quot;)
strEmployeeName = Myform.gobjMIMS.Screen.MSO.Fields(&quot;EMP_NAME1I&quot;)
strPhysicalLocation = Myform.gobjMIMS.Screen.MSO.Fields(&quot;PHYS_LOC1I&quot;)
strPhysicalLocationDesc = Myform.gobjMIMS.Screen.MSO.Fields(&quot;PHYS_LOC_DESC1I&quot;)
strRoster = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ROSTER1I&quot;)
strRosterDesc = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ROSTER_DESC1I&quot;)
strAward = Myform.gobjMIMS.Screen.MSO.Fields(&quot;AWARD1I&quot;)
strAwardDesc = Myform.gobjMIMS.Screen.MSO.Fields(&quot;AWARD_DESC1I&quot;)
strRateReference = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RREF1I&quot;)
strRateReferenceDesc = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RREF_DESC1I&quot;)
strRateRefType = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RREF_TYPE1I&quot;)
strRateRefAmount = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RREF_AMOUNT1I&quot;)
strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I1&quot;)
strTranDate = Trim(strTranDate)
If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I1&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I1&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I1&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I1&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I1&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I1&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I1&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I1&quot;)
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1 - 1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I1&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I1&quot;)
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1 - 1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I1&quot;)
End If
End If

strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I2&quot;)
strTranDate = Trim(strTranDate)
If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I2&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I2&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I2&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I2&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I2&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I2&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I2&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I2&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I2&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I2&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I2&quot;)
End If
End If

strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I3&quot;)
strTranDate = Trim(strTranDate)

If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I3&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I3&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I3&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I3&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I3&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I3&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I3&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I3&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I3&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I3&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I3&quot;)
End If
End If

strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I4&quot;)
strTranDate = Trim(strTranDate)

If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I4&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I4&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I4&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I4&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I4&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I4&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I4&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I4&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I4&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I4&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I4&quot;)
End If
End If

strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I5&quot;)
strTranDate = Trim(strTranDate)

If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I5&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I5&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I5&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I5&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I5&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I5&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I5&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I5&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I5&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I5&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I5&quot;)
End If
End If

strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I6&quot;)
strTranDate = Trim(strTranDate)

If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I6&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I6&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I6&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I6&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I6&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I6&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I6&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I6&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I6&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I6&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I6&quot;)
End If
End If


strTranDate = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I7&quot;)
strTranDate = Trim(strTranDate)

If strTranDate >= sFromDate Then
If strTranDate > sToDate Then
strjunk = &quot;Do nothing&quot;
Else
int2 = int2 + 1
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;TRAN_DATE1I7&quot;)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 4) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;WORK_CODE1I7&quot;)
strStartTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_START1I7&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 2) = strStartTime
intpos = InStr(strStartTime, &quot;.&quot;)
intpos1 = intpos - 1
strStartHours = Left(strStartTime, intpos1)
strStartMins = Right(strStartTime, 2)
intstarthours = strStartHours
intstartmins = strStartMins
strStopTime = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ACT_STOP1I7&quot;))
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 3) = strStopTime
intpos = InStr(strStopTime, &quot;.&quot;)
strStopHours = Left(strStopTime, intpos - 1)
strStopMins = Right(strStopTime, 2)
intstophours = strStopHours
intstopmins = strStopMins
If intstophours > intstarthours Then
intworkhrs2 = intstophours - intstarthours
End If
If intstophours = intstarthours Then
intworkhrs2 = 0
End If
If intstopmins > intstartmins Then
intworkmin2 = intstopmins - intstartmins
End If
If intstopmins = intstartmins Then
intworkmin2 = intstopmins
End If
If intstopmins < intstartmins Then
intworkmin2 = intstartmins - intstopmins
intworkhrs2 = intworkhrs2 - 1
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 5) = intworkhrs2
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 6) = intworkmin2
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE11I7&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS11I7&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE21I7&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS21I7&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
strAllowanceCode = Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_CODE31I7&quot;)
If strAllowanceCode = &quot;004&quot; Then
strAllowanceUnits = Trim(Myform.gobjMIMS.Screen.MSO.Fields(&quot;ALLOW_UNITS31I7&quot;))
intpos = InStr(strAllowanceUnits, &quot;.&quot;)
intpos1 = intpos - 1
strLunchHours = Left(strAllowanceUnits, intpos1)
strLunchMinutes = Right(strAllowanceUnits, 2)
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 7) = strLunchHours
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 8) = strLunchMinutes
End If
frmPayLab2.MSFlexGrid1.TextMatrix(int2, 9) = Myform.gobjMIMS.Screen.MSO.Fields(&quot;RATE_REF1I7&quot;)
End If
End If

If frmPayLab2.MSFlexGrid1.TextMatrix(int2, 1) = &quot;&quot; Then
Exit For
End If

Myform.gobjMIMS.Screen.MSO.Commands(&quot;OK&quot;).Execute
If Myform.gobjMIMS.Screen.MSO.Name = &quot;MSM89TA&quot; Then
Exit For
End If
int3 = int2
Next int3

If Trim(Myform.gobjMIMS.Screen.MSO.Error) <> &quot;&quot; Then
MsgBox Myform.gobjMIMS.Screen.MSO.Error
End If

Myform.gobjMIMS.Screen.MSO.Commands(&quot;Home&quot;).Execute
End Function

 
Dianne,

Thank you posting your code.
I think this example could be very useful for many, including myself as we upgrade to Ellipse and already had a requirement in mind for a very similar situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top