0

This is my problems at VB.net 2012, when I'm run, show this error: data type mismatch criteria expression

Public Sub AddPOS()
    vatAmount = Format((lblTotalCost.Text * 0.12), "#,##0.00")
    nonVatAmount = Format(lblTotalCost.Text - vatAmount, "#,##0.00")
    Try
        sqL = "INSERT INTO POS(InvoiceNo, POSDate, POSTime, NonVatAmount, VatAmount, TotalAmount, StaffID, CustomerNo) VALUES('" & lblInvoiceNo.Text & "', '" & Format(Date.Now, "Short Date") & "', '" & Format(Date.Now, "Long Time") & "', '" & nonVatAmount & "', '" & vatAmount & "', '" & lblTotalCost.Text & "', '" & frmMain.lblEmployeeNo.Text & "'," & Val(lblCustomerNo.Text) & ")"
        ConnDB()
        cmd = New OleDbCommand(sqL, conn)

        cmd.ExecuteNonQuery()
    Catch ex As Exception
        MsgBox(ex.Message)
    Finally
        cmd.Dispose()
        conn.Close()
    End Try
End Sub
Delimitry
  • 2,987
  • 4
  • 30
  • 39

0 Answers0