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

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]

Relevant Pages

  • A general solution
    ... Split on an array of delimiters; parse a file in one call. ... Hi Gerry,If the string is using comma to separate name and using quotation ... var element; ... Gerry Hickman wrote: ...
  • Re: Beginner code - splitting lines on whitespace
    ... And split each line into a list, returning a list of lists: ... You could you the suggested SPLIT-SEQUENCE code or for a more full-blown ... "Splits string on whitespace, meaning spaces and tabs" ... in the delimiters to this function. ...
  • Re: Reading LAST line from text file without iterating through the file?
    ... There are also count prefix formats. ... including perhaps spaces and line-end characters. ... additional structure that cannot be represented natively in a String, ... delimiters does not work. ...
  • Re: How to code an Insert query
    ... Won't this insert double quotes around the value being ... What he is doing is creating a string that will be passed to the ... delimiters in the string you create. ... Msgbox strQuery ...
  • Re: CSV and regex s.split(",") and empty fields
    ... The key point is that there appears to be a BUG in the Microsoft regex implementation of the JScript String.splitmethod. ... var n = a.length; ... delimiters, I believe the code examples I posted on the 30th Aug 09 are ... If the string is using comma to separate name and using quotation mark to ...