我有两个表代表团和劳工。在这种情况下,我有10个代表团和5个劳工,每个代表团都有自己的时间表。委派之前和之后,我想了解接下来可以邀请谁参加下一个代表团。目前,我使用的代码不正确
Private Sub wtg()
Dim rdel As DAO.Recordset
Dim rdel2 As DAO.Recordset
Dim rwork As DAO.Recordset
Dim btest As Boolean
Set rdel = CurrentDb.OpenRecordset("select * from delegations order by freetime;")
With rdel
.MoveFirst
Set rdel2 = CurrentDb.OpenRecordset("select * from delegations order by dhrs", dbOpenSnapshot)
Set rwork= CurrentDb.OpenRecordset("select * from Labor order by freetime", dbOpenSnapshot)
rdel2.MoveFirst
rwork.MoveFirst
Do While Not rdel.EOF
.Edit
!wrkr = rwork!labour
.Update
rdel.MoveNext
rwork.MoveNext
If rwork.EOF Then
rwork.MoveFirst
btest= True
End If
Loop
End With
Set rdel = Nothing
Set rdel2 = Nothing
Set rwork= Nothing
End sub
我想要屏幕截图(第二张表)中给出的结果。即L1在07:10空闲,因此他可以在第二个自由人之前选择代表团DEL3。接下来是空闲的L3可以选择Del5,然后在8:00再次获得免费,我需要红色突出显示的部分,因为我的结果如何获得?您可以修复代码吗?