Results 1 to 3 of 3
  1. #1
    smeghead67 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    31

    Question Saving the current Date problem

    Hello,



    I have a form that I'm using to enter the date into a two tables. On the form the field is [createdate] in the properties it has an input mask of 99/99/0000;0;_ and a default value of =date()

    The the fields on the tables that i insert this info into are Date/time and have an input mask of 99/99/0000;0;_ and no default value.

    when i run the insert query, I get no errors. When i view the tables, the info in those fields is 12:05:44 AM

    What?!? If i do a Dlookup in immediate mode, that is what i get too

    Please help me.
    Ted

  2. #2
    smeghead67 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    31

    Solved it myself

    Ok, I solved this myself...

    When i ran my insert query

    Code:
    DoCmd.RunSQL "INSERT INTO [takeapart] ([createdate]) VALUES (" & [Forms]![takeapart]![createdate] & " );"
    Should have been,

    Code:
    DoCmd.RunSQL "INSERT INTO [takeapart] ([createdate]) VALUES (#" & [Forms]![takeapart]![createdate] & "# );"
    When you are dealing with Dates, always put the # symbol before and after the date to be inserted.

    Ted

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Thanks for sharing your solution.

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

Similar Threads

  1. Replies: 5
    Last Post: 04-03-2012, 07:24 AM
  2. Replies: 1
    Last Post: 12-07-2011, 01:02 PM
  3. SQL Inner Join where date = current date
    By Tyork in forum Queries
    Replies: 2
    Last Post: 11-07-2010, 02:07 PM
  4. Comparing Date with current Date
    By ds_8805 in forum Forms
    Replies: 7
    Last Post: 03-31-2010, 09:31 PM
  5. Replies: 9
    Last Post: 03-19-2010, 10:37 AM

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