INSERT INTO fails w "Missing Parameter"

D

David Habercom

Can someone clarify for me why this crashes:

Dim strSQL As String
strSQL = "INSERT INTO MtchStaffTbl (MchStfFNo, MchStfIDCode) " & _
"VALUES (Me.EnFNo, Me.StaffAddLstBx);"
CurrentDb.Execute strSQL, dbFailOnError

The message is "Too few Parameters. Expected 2."

Thanks in advance.
 
K

Klatuu

This looks suspicious:
Me.StaffAddLstBx)

Is AddLstBx a List Box control on you form? If not, what is it?
 
D

David Habercom

Yes. Me.StaffAddLstBx is a list box, and the bound column contains the
correct text data...
 
K

Klatuu

Sorry, I am not seeing the problem. Since I have never used a List Box like
this, I don't know if that is a problem or not. I think it should not be,
but I would have use a Combo. As a test, try pluggin a value in by hand and
running it to see what happens:

"VALUES (Me.EnFNo, 99);"
 

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


Top