Results 1 to 3 of 3
  1. #1
    geraldk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    49

    Insert date function

    Hello,



    I am having problems, I need to insert values from my form in a date function and when it's insert into my tables it gives me time value instead of a date. Before I insert the values I format the date value I format the date into MM/DD/YYYY

    Code:
         
        strdate = Format(Me.txtEMPVACDate, "MM/DD/YYYY")
        
       
        strINSERT = "INSERT INTO TBLEMPVAC values (" & Me.txtEMPVACID.value & ", " & Me.txtEMPID.value & "," & Me.cboVACID.value & "," & strdate & ")"
           
            
        DoCmd.RunSQL strINSERT
    Can anyone see what I am doing wrong in the statement above to help me?

    Thank you,

    Happy New Year

  2. #2
    geraldk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    49
    sorry I forgot to post this.

    When this date get saved into the table is shows 12:00am.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Dave values need to be surrounded by #.
    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. Insert date and time into excel sheet.
    By alphaol in forum Forms
    Replies: 5
    Last Post: 11-23-2011, 03:09 PM
  2. Replies: 6
    Last Post: 09-09-2011, 10:26 AM
  3. Date Function
    By joewhitt in forum Queries
    Replies: 7
    Last Post: 07-17-2011, 07:22 PM
  4. Replies: 7
    Last Post: 12-15-2010, 09:46 AM
  5. SQL INSERT INTO Date Syntax Error
    By tuna in forum Programming
    Replies: 5
    Last Post: 08-10-2010, 06:17 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