I have the following code where I am trying to copy the value of one table to another and for some reason that I can not figure out, the code is not working
Option Compare Database
Public Function taskschedule()
Dim DB As Database
Dim RS As Recordset
Dim SQL As String
Dim Descr As String
Set DB = CurrentDb
Set RS = DB.OpenRecordset("TbTask", dbOpenDynaset, dbSeeChanges)
Descr = RS!taskdescription
Do Until RS.EOF
SQL = " INSERT INTO tbtaskshedule[taskdescription] VALUES ('" & Descr & "')"
DB.Execute (SQL)
RS.MoveNext
Loop
DB.Close
RS.Close
Set RS = Nothing
End Function
Option Compare Database
Public Function taskschedule()
Dim DB As Database
Dim RS As Recordset
Dim SQL As String
Dim Descr As String
Set DB = CurrentDb
Set RS = DB.OpenRecordset("TbTask", dbOpenDynaset, dbSeeChanges)
Descr = RS!taskdescription
Do Until RS.EOF
SQL = " INSERT INTO tbtaskshedule[taskdescription] VALUES ('" & Descr & "')"
DB.Execute (SQL)
RS.MoveNext
Loop
DB.Close
RS.Close
Set RS = Nothing
End Function