Check SQL

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi

Appreciate if someone can check my sql for me. I keep getting the error
3134.

Thanks in advance
Richard

Syntax:

strSQL = "INSERT INTO Payment (PaymentId, PaymentType, CompanyId, " & _
"PaymentDate, ChequeNo, TotalAmount, BankSlipNo, EntryStamp, "
& _
"Memo, ReceiptId, ReceiptNo) VALUES (""" & Me.txtPaymentID &
""", " & _
"""" & Me.CmbPayType & """, """ & Me.txtCustomerId & """, " & _
"""" & Me.txtPaymentDate & """, """ & Me.txtchequeno & """, " &
_
"""" & Me.txtfeespaid & """, """ & Me.txtBankSlipNo & """, " &
_
"""" & Me.txtentrystamp & """, """ & Me.txtmemo & """, " & _
"""" & Me.txtreceiptid & """, & """ & Me.txtreceiptno & """"
 
Hi,
Without knowing the data types I'm only guessing here but...
Strings should be delimited with quotes, dates (PaymentDate?) with #
and numbers (CompanyId?) require no delimiters.

You've delimited *everything* with quotes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Syntax error 8
Checking null field in SQL 4
Problem with SQL 5
too few parameters in SQL statement (expected 1) 2
SQL in VB Code 1
Having trouble with some sql 3
can't determine the syntax error 1
SQL Syntax 1

Back
Top