Stormrider83
Computer Science Student
- Local time
- Today, 20:59
- Joined
- Jul 16, 2008
- Messages
- 26
Hi,
I have looked for solutions to this but can't find one that exactly matches it so here goes. With the following code I get the error 3061 - Too few parameters. Expected 2:
The offending lines are:
I have no idea why its happening...
I have looked for solutions to this but can't find one that exactly matches it so here goes. With the following code I get the error 3061 - Too few parameters. Expected 2:
Code:
Private Sub Command22_Click()
Dim lngPaint_Order_ID As Long
Dim strSQL As String
Set rs = New ADODB.Recordset
strSQL = "INSERT INTO Paint_Orders (Paint_Order, Supplier_Name, Paint_Color) VALUES ('" & Me.Text18 & "'," & Combo20 & ",'" & Combo24 & "')"
CurrentDb.Execute strSQL
strSQL = " SELECT Paint_Orders.Paint_Order_ID, Paint_Order.Paint_Orders FROM Paint_Orders WHERE Paint_Order_ID.Paint_Orders = '" & [Forms]![Paint_Order]![Text18] & "';"
Set rs = CurrentDb.OpenRecordset(strSQL)
lngPaint_Order_ID = Paint_Orders.Paint_Order_ID
rs.Close
Set rs = Nothing
strSQL = " INSERT INTO Paint_Order_Parts (Part_No, Paint_Order, Qty) " _
& "SELECT Part_No, " & lngPaint_Order_ID & ", 0 " _
& " FROM [Parts];"
CurrentDb.Execute strSQL
Text18.SetFocus
Text18.Text = ""
Me.Combo26.Requery
End Sub
The offending lines are:
Code:
strSQL = " SELECT Paint_Orders.Paint_Order_ID, Paint_Order.Paint_Orders FROM Paint_Orders WHERE Paint_Order_ID.Paint_Orders = '" & [Forms]![Paint_Order]![Text18] & "';"
Set rs = CurrentDb.OpenRecordset(strSQL)
I have no idea why its happening...