Re: Updating Code from Access 2000 to 2003/2007



On Wed, 14 Nov 2007 08:40:02 -0800, Scot McPherson <Scot
McPherson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Is there a syntactical change I can make, to make these variable
declarations operate in Office 2003/7 ?


I'll assume that strTNO and dtOrigSusp are a string and date VBA variable
respectively.

Try putting in delimiters:

DoCmd.RunSQL "Insert into [TempNewTSS] select * from tasklog where
Tasker_no='" & strTNO & "'"

For clarity, that's including a singlequote character ' before and after the
value of strTNO.

Date fields need # as a date delimiter: try

DoCmd.RunSQL "update [TempNewTSS] set OrigSuspense = #" & Format(dtOrigSusp,
"mm/dd/yyyy" & "#"

I'm a bit surprised this ever worked.

John W. Vinson [MVP]
.