Good Evening,
Please forgive me for such a rudimentary question, but I am very new to coding.
I have an access database that schedules job tasks based on scheduled work orders. I need to write a loop that will look at each work order and based on status and assigned team, execute an append query. The append query moves a predetermined set of job tasks to a master daily work schedule.
Below are two separate loops that I have been trying to use. Both look at one work order and then exits. Can someone help me, please?
Dim lastrow
lastrow = rs.EOF
For i = lastrow To 0 Step -1
If order_status.Value = "1" _
And assigned_team.Value = 1 Then
db.Execute "qry-append-team-1"
ElseIf order_status.Value = "1" _
And assigned_team.Value = 2 Then
db.Execute "qry-append-team-2"
ElseIf order_status.Value = "1" _
And assigned_team.Value = 3 Then
db.Execute "qry-append-team-3"
ElseIf order_status.Value = "1" _
And assigned_team.Value = 4 Then
db.Execute "qry-append-team-4"
End If
Next I
With rs
Do Until .EOF
If !order_status = "1" Then
Select Case !assigned_team
Case "1": db.Execute "qry-append-team-1"
Case "2": db.Execute "qry-append-team-2"
Case "3": db.Execute "qry-append-team-3"
Case "4": db.Execute "qry-append-team-4"
End Select
End If
.MoveNext
Loop
.Close
End With