Having a strange error with a SQL statement in VBA. I'm trying to update an additional form via SQL and getting the dreaded "Enter Parameter Value" issue. I can't see why though especially as some variables are working without issue.
I'm using a bound form so the data is saved to a bookings table and this code should fill the order form to give defaults when the user comes to complete the order and confirm the details. The SQL code I have is this:
Some work but others don't, the fields are correct because if you enter a value in the "Enter Parameter Value" box it goes to the right field. So I thought it was a data type issue because I am using a lot of list and combo boxes, so I created a simple text box and changed the field type to text. That still didn't work. I have tried just assigning a variable with data and passing that, nope. I changed the row source for the combo boxes, uh uh. I made sure they were the same in both forms, nah. Damn!
So could you see what I might be missing? I could upload some of the database if it will help but this involves a few tables and a big form so it won't be tiny.
Cheers,
Jamie
PS. There are a couple of us using this account so the other thread we have open is still live!
I'm using a bound form so the data is saved to a bookings table and this code should fill the order form to give defaults when the user comes to complete the order and confirm the details. The SQL code I have is this:
Code:
Dim strSQL As String
strSQL = "INSERT INTO [Completed Orders]([Order Number],[Status],[Actual Amount],[Actual Mix],[Actual Slump],[Actual Extras],[Actual Driver],[Actual Lorry],[Actual Delivery Type],[Actual Wait Time],[Actual Wait Charge]) VALUES (" & Me.txtOrderNumber & "," & Me.txtTestBox.Value & "," & Me.txtOrderAmount & "," & Me.comboRequiredMix & "," & Me.comboSlump.Text & "," & Me.comboOrderExtras & "," & Me.comboDriver.Value & "," & Me.comboLorry & "," & Me.comboDeliveryType & "," & Me.txtWaitTime & "," & Me.txtWaitCharge & ")"
'
DoCmd.RunSQL strSQL
Some work but others don't, the fields are correct because if you enter a value in the "Enter Parameter Value" box it goes to the right field. So I thought it was a data type issue because I am using a lot of list and combo boxes, so I created a simple text box and changed the field type to text. That still didn't work. I have tried just assigning a variable with data and passing that, nope. I changed the row source for the combo boxes, uh uh. I made sure they were the same in both forms, nah. Damn!
So could you see what I might be missing? I could upload some of the database if it will help but this involves a few tables and a big form so it won't be tiny.
Cheers,
Jamie
PS. There are a couple of us using this account so the other thread we have open is still live!
Last edited: