Results 1 to 8 of 8
  1. #1
    joycesolomon is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    11

    NOW() Function not updating into table

    Hi all,

    Can you please help. The below is not working.

    The Now() function is not passing the timestamp back to the table

    HEre is the code...

    Code:
     DoCmd.RunSQL "UPDATE [Approve_Close]" _
                        & "SET [PR-PL] = '" & Me.PRPL & "' ,[PR-PL_DATE] =  Now()" _
                        & "Where [Project Number] = '" & Me.Project_Number & "';"


  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    You have a problem with spaces that may be the problem. See if this helps:

    http://www.baldyweb.com/ImmediateWindow.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    joycesolomon is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    11
    It says

    Expression --->PR-PL_DATE
    Value ---> <Expression not defined in context>

    Type ---> Empty

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Did you fix the spaces and test? What is the finished SQL?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    joycesolomon is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    11
    there was no space issue, this was the result of the finished SQL

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Okay, sorry to have wasted your time.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    joycesolomon is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    11
    no , not at all.

    Maybe you can give me a better idea and resolution.

    I need to be able to update PR_PL_DATE field at table with current timestamp and [Project Status] field with the word 'review' when the button is clicked

    How do i write the sql? the table has other fields that has value that will not be changing.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Did you try the debugging technique to see how the SQL you're building ends up? If so, what is that SQL? If not, why not?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 03-02-2014, 08:47 PM
  2. Replies: 2
    Last Post: 05-19-2013, 07:22 PM
  3. Updating main table from temp table AND form value
    By shabbaranks in forum Programming
    Replies: 8
    Last Post: 05-01-2013, 07:18 AM
  4. Replies: 2
    Last Post: 03-13-2013, 06:30 AM
  5. Replies: 6
    Last Post: 05-10-2012, 08:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums