Hy,
I use a Table Query to generate a table, and i want to add a Field in this newly created table.
So this is the code i use...
The problem is that it does not create the field and it blocks at
!WEEK_STATUS
Can anyone help me out? thx in advance
I use a Table Query to generate a table, and i want to add a Field in this newly created table.
So this is the code i use...
The problem is that it does not create the field and it blocks at
!WEEK_STATUS
Code:
Sub Moveinto()
Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Dim MyTable As DAO.TableDef
Dim x As String
Set MyDB = CurrentDb
Set MyTable = MyDB.CreateTableDef("Retreived_Data", dbOpenDynaset)
With MyTable
.Fields.Append .CreateField("WEEK_STATUS", dbText, 7)
End With
Set MyRS = MyDB.OpenRecordset("Retreived_Data", dbOpenDynaset)
With MyRS
.MoveFirst
.Requery
While Not .EOF
x = CStr(Year(.Fields("SYSMODTIME").Value) & "w" & Format(.Fields("SYSMODTIME").Value,"ww"))
.Edit
!WEEK_STATUS = x
Debug.Print .Fields(0).Value & .Fields(4).Value
.MoveNext
.Update
Wend
End With
End Sub
Can anyone help me out? thx in advance