Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Error 3134

Status
Not open for further replies.

Iainkerr

Technical User
Jan 4, 2010
2
GB
I am running Access 2000 on Windows XP. I am trying to write to a table 'ClientTransactions' from the 'On Close' event in a report and am getting a Runtime 3134 error.

The VBA coding is as follows:

strQuery = ("INSERT INTO ClientTransactions (clientID, projectID, date, number, type, description, debitamount, creditamount)" & _
" VALUES (" & clientID & "," & projectID & "," & Date & "," & invoiceno & "," & "Inv" & "," & "Design Invoice" & "," & TotalDue & "," & 0 & ")")
DoCmd.RunSQL strQuery

where clientID, projectID, debitamount and creditamount are numbers,
date is a date field
number is a text field
and "Inv" and "Design Invoice" are fixed texts going into text fields on the table.
 
I'd try this:
Code:
strQuery = "INSERT INTO ClientTransactions (clientID,projectID,[date]" _
& ",[number],[type],[description],debitamount,creditamount)" _
& " VALUES (" & clientID & "," & projectID & ",#" & Format(Date, "yyyy-mm-dd") _
& "#,'" & invoiceno & "','Inv','Design Invoice'," & TotalDue & ",0)"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top