Public Sub Zapolnit_Table(Name As String) ' Занесение дней в таблицу
Dim Data1 As Date
Dim S1 As dao.Recordset
Set S1 = CurrentDb.OpenRecordset(Name, dbOpenDynaset)
If S1.RecordCount > 0 Then S1.MoveFirst
Data1 = ("01,01," & Forms![Free_Film]![God])
For f = 1 To 365
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
|