Good Day. I have a form that contains a sub-form. The sub-form has a command button to insert the contents of the sub-form into a table. I am trying to reference a textbox on the main form for the order number. It is a one to many situation where the main form information is a single order and the subform has multiple entries for the order.
Code:
strInsertItemSQL = "INSERT INTO OrderDetails (OrderNo, SKU, Qty, ArtStatus, ArtProvided, PZInfo, Process, Date_Time)" _
& "VALUES ('" & Forms!frmNewWO!tbxNewOrderNo.Value & "'& Me.cbxItemSKU & Me.tbxSKUQty.Value & '" & Me.cbxArtStatus & "','" & Me.chkProvided & "','" & Me.tbxPZInfo & "','" & Me.cbxProcess1 & "','# & Date_Time & #');"
I have tried a couple of different variants (Forms!tbxNewOrderNo, Forms.tbxNewOrderNo, Forms!NewWO!tbxNewOrderNo, Forms!NewWO.tbxNewOrderNo, Parent!tbxNewOrderNo). I have gotten a couple of different errors: object not supported, number of query calues and destination..., etc.
As always, any assistance would be greatly appreciated.