Rx_
Nothing In Moderation
- Local time
- Yesterday, 18:28
- Joined
- Oct 22, 2009
- Messages
- 2,803
This question is really about exiting early if one Field receives an "Eliminated" status.
Having started with a Do Until - there doesn't seem to be a way to exit midway in the Field evaluation.
This example only has 2 fields while the real one has many more.
Each field has a different formula for EvaluateRecord. This example criteria is hard-coded for demo. If Field 1 is Eliminate, there is no need to continue with Field 2, 3, ...25. Is there an easy exit criteria for the fields?
Keep in mind, the next Record needs to be evaluated.
Basically, for a proof of concept, each Column is evaluated. If Column 1 receives "eliminated" in the EvaluatedRecord (11) then Exit the loop
but move to the next record and evaluate the columns for that record.
Attached is an example of a Local Table that is populated.
Record 1 is the Source - that value is Evaluated against the rest of the records.
Hope this is simple, have been in since 4AM working on the bigger part of this project. 
Having started with a Do Until - there doesn't seem to be a way to exit midway in the Field evaluation.
This example only has 2 fields while the real one has many more.
Each field has a different formula for EvaluateRecord. This example criteria is hard-coded for demo. If Field 1 is Eliminate, there is no need to continue with Field 2, 3, ...25. Is there an easy exit criteria for the fields?
Keep in mind, the next Record needs to be evaluated.
Basically, for a proof of concept, each Column is evaluated. If Column 1 receives "eliminated" in the EvaluatedRecord (11) then Exit the loop
but move to the next record and evaluate the columns for that record.
Attached is an example of a Local Table that is populated.
Record 1 is the Source - that value is Evaluated against the rest of the records.
Code:
' **************** Begin evaluating Each Record - Column By Column ***********************
' **************** Note - if one Column is assigned "Eliminate" then don't evaluate next Column
' **************** Move to next record set and sart with first column
160 Do Until RSEvaluate2WellsFieldWorkDates.EOF ' Note - once any column results in "eliminate" go to next record
' ******************** Start Test Date 1 ******** If Column 1 is Eliminated - no need to test Column 2,3,4,5,6,7 **************
170 If IsDate(Dt_SurveyEVAL) Then ' Date 1
180 If IsDate(RSEvaluate2WellsFieldWorkDates.Fields(4)) Then ' both are dates
190 If Abs(Dt_SurveyEVAL - RSEvaluate2WellsFieldWorkDates.Fields(4)) < 4 Then ' Dates match ' CUSTOM Formula
200 RSEvaluate2WellsFieldWorkDates.Edit
210 RSEvaluate2WellsFieldWorkDates.Fields(11) = "Match"
220 RSEvaluate2WellsFieldWorkDates.Update
230 Else
240 RSEvaluate2WellsFieldWorkDates.Edit
250 RSEvaluate2WellsFieldWorkDates.Fields(11) = "Eliminate" ' Dont Match If Eliminated, move next record
260 RSEvaluate2WellsFieldWorkDates.Update
270 End If
280 Else ' Current Target is Null
290 RSEvaluate2WellsFieldWorkDates.Edit
300 RSEvaluate2WellsFieldWorkDates.Fields(11) = "PossibleUpdate" ' Orginal Date - Target Null
310 RSEvaluate2WellsFieldWorkDates.Update
320 End If
330 Else ' Both source and Target are Null
340 RSEvaluate2WellsFieldWorkDates.Edit
350 RSEvaluate2WellsFieldWorkDates.Fields(11) = "Match" ' Still counts as a Match
360 RSEvaluate2WellsFieldWorkDates.Update
370 End If
' ******************** END Test Date 1 **********
' ******************** Start Test Date 2 ********
380 If IsDate(Dt_Arch_ReqEVAL) Then ' Date 2
390 If IsDate(RSEvaluate2WellsFieldWorkDates.Fields(5)) Then ' both are dates
400 If Abs(Dt_SurveyEVAL - RSEvaluate2WellsFieldWorkDates.Fields(5)) < 7 Then ' Dates match ' CUSTOM Formula
410 RSEvaluate2WellsFieldWorkDates.Edit
420 RSEvaluate2WellsFieldWorkDates.Fields(11) = "Match"
430 RSEvaluate2WellsFieldWorkDates.Update
440 Else
450 RSEvaluate2WellsFieldWorkDates.Edit
460 RSEvaluate2WellsFieldWorkDates.Fields(11) = "Eliminate" ' Dont Match If Eliminated, move next record
470 RSEvaluate2WellsFieldWorkDates.Update
480 End If
490 Else ' Current Target is Null
500 RSEvaluate2WellsFieldWorkDates.Edit
510 RSEvaluate2WellsFieldWorkDates.Fields(11) = "PossibleUpdate" ' Orginal Date - Target Null
520 RSEvaluate2WellsFieldWorkDates.Update
530 End If
540 Else ' Both source and Target are Null
550 RSEvaluate2WellsFieldWorkDates.Edit
560 RSEvaluate2WellsFieldWorkDates.Fields(11) = "Match" ' Still counts as a Match
570 RSEvaluate2WellsFieldWorkDates.Update
580 End If
590 RSEvaluate2WellsFieldWorkDates.MoveNext
600 Loop
