Hi,
I’m looking for help on something I’m trying to do. I have a Sales Order Entry Screen. It’s a Main Form with Two Separate Subforms. One Subform is the Items Order Entry Part where the products sold get selected/entered with quantity and cost. The other Subform shows a list of the items the customer has purchased in the past. I’d like to be able to click an item in the Templates Subform (products purchased in the past) and have it auto entered or copied into the other subform (the actual order.) I’m not a trained/skilled programmer. I’ve tried everything I know to try but I’ve not been successful. This is what I have so far. Probably not even close…
If you’re able to help, I’d greatly appreciate it!!!
Private Sub cmdAddItem_Click()
On Error GoTo btnAddProduct_Click_error
Dim S As String
If Nz(Me![ITEMNUM].Column(0), "") = "" Then
GoTo btnAddProduct_Click_Exit
End If
S = Me![ITEMNUM].Column(0)
' DoCmd.RunCommand acCmdSaveRecord
Forms![frmSalesOrders]![ItemsPanel].SetFocus
If Me.NewRecord Then
Me![InvoiceItemDescription] = S
Me![InvoiceHeaderCustomer].Requery
Else
DoCmd.RunCommand acCmdRecordsGoToNew
Me![InvoiceItemDescription] = S
Me![InvoiceHeaderCustomer].Requery
End If
' DoCmd.RunCommand acCmdSaveRecord
btnAddProduct_Click_Exit:
On Error Resume Next
Exit Sub
btnAddProduct_Click_error:
Select Case Err
Case Else
MsgBox Err & "-" & Error$, vbCritical + vbOKOnly, "Error in module btnAddProduct_Click"
Resume btnAddProduct_Click_Exit
End Select
End Sub