Public Sub Zapolnit_Table(Name As String) '' Занесение дней в таблицу
Dim Data1 As Date
Dim f As Long
Dim f1 As Long
Dim S1 As dao.Recordset
If (Forms![Free_Film]![God] / 4) = Int((Forms![Free_Film]![God]) / 4) Then
f1 = 364
Else
f1 = 365
End If
Set S1 = CurrentDb.OpenRecordset(Name, dbOpenDynaset)
If S1.RecordCount > 0 Then S1.MoveFirst
Data1 = ("01,01," & Forms![Free_Film]![God])
For f = 1 To f1
S1.AddNew
S1!Film_Name = Forms![Free_Film]![Film_Name]
S1!Date_First_Air = Data1
S1.Update
Data1 = DateAdd("d", 1, Data1)
Next f
Set S1 = Nothing
End Sub
|