26/06/2021, 22:56
aşağıdaki kodu dener misiniz?
Dim GSayi As Integer
Dim GTarih As Date
For GSayi = 1 To 30
GTarih = DateAdd("d", GSayi - 1, DateSerial(Year(Date), 7, 1))
CurrentDb.Execute "update tbl_PERSONEL set Tarih" & GSayi & "= '' " 'where SICILNO=" & rs(0)
Controls("Tarih" & GSayi & "_Etiket").Caption = Format(GTarih, "dd mmm")
Next GSayi
' Exit Sub
Dim rs As ADODB.Recordset
Set db = CurrentDb
Set rs = New ADODB.Recordset 'db.OpenRecordset("tbl_IZINLER") 'myTable is a MS-Access table created previously
txtSQL = "SELECT SICILNO, IZINBASLANGICTARIHI, IZINBITISTARIHI " & _
"FROM tbl_IZINLER order by SICILNO;"
rs.Open txtSQL, CurrentProject.Connection, 3, 1
'populate the table
rs.MoveLast
rs.MoveFirst
'Debug.Print rs.Fields.Count
Do While Not rs.EOF
' Debug.Print (rs(0)) 'myField is a field name in table myTable
For GSayi = 1 To 30
GTarih = DateAdd("d", GSayi - 1, DateSerial(Year(Date), 7, 1))
If GTarih >= rs(1) And GTarih <= rs(2) Then CurrentDb.Execute "update tbl_PERSONEL set Tarih" & GSayi & "='X' where SICILNO=" & rs(0)
Next GSayi
rs.MoveNext
Loop