Y
yami_86 via AccessMonster.com
I need help to do a append query in VBA.
The code is the following:
Public Sub CreateForm()
Dim DateInv As String
Dim strQryDelete As String
Dim strQryAppend As String
DateInv = fnGetDate ' fnGetDate is a function that gets the date from an
input box (mmddaaaa)'
strQryDelete = "DELETE * FROM tblCourseReport"
strQryAppend = "INSERT INTO tblCourseReport SELECT" & DateInv & " From "
& DateInv
DoCmd.RunSQL strQryDate
DoCmd.RunSQL strQryAppend
Note:
***DateInv is the variable that changes everyday. The table is name after the
variable for example: 04032009.
All the field values in DateInv is added to another table in the Current
Database which is tblCourseReport but I just don't know how to do this. You
can see that the strQryAppend is not correct and I get code errors.
Please help me to make this WORK.!!!!!!!!
Thanks
The code is the following:
Public Sub CreateForm()
Dim DateInv As String
Dim strQryDelete As String
Dim strQryAppend As String
DateInv = fnGetDate ' fnGetDate is a function that gets the date from an
input box (mmddaaaa)'
strQryDelete = "DELETE * FROM tblCourseReport"
strQryAppend = "INSERT INTO tblCourseReport SELECT" & DateInv & " From "
& DateInv
DoCmd.RunSQL strQryDate
DoCmd.RunSQL strQryAppend
Note:
***DateInv is the variable that changes everyday. The table is name after the
variable for example: 04032009.
All the field values in DateInv is added to another table in the Current
Database which is tblCourseReport but I just don't know how to do this. You
can see that the strQryAppend is not correct and I get code errors.
Please help me to make this WORK.!!!!!!!!
Thanks