error 3061

B

Bill

SQL is issuing the error 3061: "Too few
parameters. Expected 6."

I don't see the problem.

strSQL = "Insert Into Transactions
(FolioID,TransDate,TransCodeID,TransDescID,"
strSQL = strSQL & "TransMemo,TransExp,TransInc,TransBal) "
strSQL = strSQL & "VALUES (""" & [FolioID] & """, [TransDate],
[TransCodeID], [TransDescID], "
strSQL = strSQL & """" & [TransMemo] & """,[TransExp], [TransInc],
[TransBal])"
CurrentDb.Execute strSQL

Data types:

Dim FolioID As String
Dim TransDate As Date
Dim TransExp As Currency
Dim TransInc As Currency
Dim TransBal As Currency
Dim TransDescID As Integer
Dim TransMemo As String
Dim TransCodeID As Integer

Does SQL/VBA get screwed up if the table names
are the same as the local variable names as you
see here?

Thanks for any thoughts here,
Bill
 
B

Bill

I found it.........forgot that the commas
needed to be represented as & "," &
rather than simply delineating the field
of values.

I hope I didn't waste anyone's time.

Bill
 
M

Mike Painter

Bill said:
I found it.........forgot that the commas
needed to be represented as & "," &
rather than simply delineating the field
of values.

Welcome to the RMOF club
I have a permanent Red Mark On Forehead from slapping myself right after
pushing sent and then seeing the solution.

I'm not sure about tables and variables as all my tables are plural
"Customers" and I might use "Customer"
However there are places wher Access can have problems and these problems
may not show up right away.
Some naming convention is always a good idea. tblCustomers, txtCustomer,...
 

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

Top