I populate the fields of one subform by using a combo box, these fields contain product details.
Once this data has been obtained i want it to be added to another subform, this is an order subform ready for the products to be ordered.
i want to do this by using a button, therefore when a user selects the prducts they want they select the 'add to order' button to add the selection to their order form.
My attempt at this button so far is as follows...
As you can see i am trying to select the fields in my product catalogue and insert them into my order form(F_Order_line_subform).
The error i am getting is that.
'Could not find output table F_Order_line_subform'.
Why is this? It isnt a table in anycase so i dont understand why its saying it is. Is there another way to acheive what i want.
Thanks in advance!
Once this data has been obtained i want it to be added to another subform, this is an order subform ready for the products to be ordered.
i want to do this by using a button, therefore when a user selects the prducts they want they select the 'add to order' button to add the selection to their order form.
My attempt at this button so far is as follows...
Code:
Private Sub AddtoOrder_Click()
On Error GoTo Err_AddtoOrder_Click
Dim sql_string As String
sql_string = "INSERT INTO F_Order_line_subform (ProductID,Category,Description,Price) SELECT '" & _
Me.Recordset.Fields("ProductID").Value & "','" & Me.Recordset.Fields("Category").Value & "','" & _
Me.Recordset.Fields("Description").Value & "','" & Me.Recordset.Fields("Price").Value & "'"
Call DoCmd.RunSQL(sql_string)
Exit_AddtoOrder_Click:
Exit Sub
Err_AddtoOrder_Click:
MsgBox Err.Description
Resume Exit_AddtoOrder_Click
End Sub
As you can see i am trying to select the fields in my product catalogue and insert them into my order form(F_Order_line_subform).
The error i am getting is that.
'Could not find output table F_Order_line_subform'.
Why is this? It isnt a table in anycase so i dont understand why its saying it is. Is there another way to acheive what i want.
Thanks in advance!
