|
Public Function Shed_generate()
CurrentDb.Execute "DELETE * FROM Shed_temp ;"
Dim , , 1, , cdata As Date
Dim ccount, I As Integer
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Shed_temp", DAO.dbOpenDynaset)
cdata = Me.
ccount = DCount("", "", " = True ")
For I = 1 To ccount
= #8:00:00 AM#
= #7:45:00 PM#
= #12:15:00 AM#
Do
rst.AddNew
rst! = cdata
rst! =
rst! = +
1 = +
Me.ccab = I
rst! = Me.ccab
If DFirst("", "Shed_doc", "(= " & Me.ccab & ") and ( = #" & Format(cdata, "mm-dd-yyyy") & "#) and ( <= #" & & "#) and ( >= # " & 1 & " #)") > 0 Then
Me.csot = DFirst("", "Shed_doc", "(= " & Me.ccab & ") and ( = #" & Format(cdata, "mm-dd-yyyy") & "#) and ( <= #" & & "#) and ( >= # " & 1 & " #)")
Else: Me.csot = 1
End If
rst! = Me.csot
If DFirst("", "Shed_pat", "(= " & Me.ccab & ") and ( = #" & Format(cdata, "mm-dd-yyyy") & "#) and ( <= #" & & "#) and ( >= # " & 1 & " #)") > 0 Then
Me.ccli = DFirst("", "Shed_pat", "(= " & Me.ccab & ") and ( = #" & Format(cdata, "mm-dd-yyyy") & "#) and ( <= #" & & "#) and ( >= # " & 1 & " #)")
Else: Me.ccli = 1
End If
rst! = Me.ccli
1 = Null
= +
rst.Update
Loop Until >=
Next I
rst.Close
Set rst = Nothing
Me. = Format(, " Dddd, c")
End Function
http://www.sql.ru/forum/1081683/ubrat-vremennuu-tablicu-i-zamenit-ee-otvyazannym-rekordsetom