stuplumley
10-31-2006, 09:11 AM
Hi, this is my second day of using VBA and I have this, hopefully simple, problem.
I want to update an Access table with results of code run against a Recordset (I have scanned the recordset for the date of incident 1, the date of incident 2 and calculated the difference).
I know want to put these 3 values (inc1Date, incDate and incDiff) into an Access table [Results], set up with 3 fields (([Date 1[Date 2], [Difference]), and then append the results of similar Recordset queries.
This doesnt work
DoCmd.RunSQL "insert into[Results] ([Date 1[Date 2], [Difference]) values (inc1Date, incDate , incDiff)"
What am I missing? The 3 variable all have valid values, which I've checked in my code, but the "append" query doesnt recognise their names. Am I missing !s or square brackets somewhere?
Thanks
I want to update an Access table with results of code run against a Recordset (I have scanned the recordset for the date of incident 1, the date of incident 2 and calculated the difference).
I know want to put these 3 values (inc1Date, incDate and incDiff) into an Access table [Results], set up with 3 fields (([Date 1[Date 2], [Difference]), and then append the results of similar Recordset queries.
This doesnt work
DoCmd.RunSQL "insert into[Results] ([Date 1[Date 2], [Difference]) values (inc1Date, incDate , incDiff)"
What am I missing? The 3 variable all have valid values, which I've checked in my code, but the "append" query doesnt recognise their names. Am I missing !s or square brackets somewhere?
Thanks