Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #16
    Originally posted by mclueless
    They are Short Dates....
    sample:-3/2/2008
    Did you check the datatypes of Inv_Date and Due_Date?

    if you're using that format, try this
    [code=vb]
    Format(Inv_Date , "d/m/yyyy")
    Format(Due_Date , "d/m/yyyy")
    [/code]


    Rey Sean

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #17
      Originally posted by mclueless
      Syntax error in date in query expression '# #' .
      This seems to imply that one or the other of your textboxes was empty. What I'd suggest as a debugging aid is to set a break point and copy/paste here the actual string which is being passed to the SQL interpreter. We've seen the code, but I believe we need to see the result of the code.

      In other words, set a break point on the Rs.Open statement. When it breaks, go to Immediate window and enter...
      [CODE=vb]Print "INSERT INTO Invoice_master( Inv_No,Inv_Date ,Inv_Type,Cust_ Code, Salesman_Code,D ue_Date) VALUES (" & Val(txtInvNo.Te xt) & ",#" & txtDate.Text & "#,'" & txtInvType.Text & "'," & Val(txtCustCode .Text) & "," & Val(txtSaleCode .Text) & ",#" & txtDue.Text & "#)"[/CODE]
      Last edited by Killer42; Feb 3 '08, 11:58 PM.

      Comment

      Working...