First off, good day to all!
I've been searching for a solution to this for weeks, can anybody here help me?... I'm a bit too novice to get my head round it
I have a form (CustomerForm) that contains general customer information with a subform (PartsForm), in datasheet view, it shows items bought by the selected customer. Now, I need to transfer the list of parts used by the particular customer into a textbox on the main form so I can merge to a word document.
So far the main form has a button that has 2 events to set the total value of parts purchased into a SubTotal textbox and this works perfectly. I don't know how to place the records in the PartsUsed texbox (please refer to the commented line in the code below for what I'm trying to achieve) and for it to work as I intend it needs to be done similar to using the CTRL+A/C/V method so i can keep the formatting (i.e. the tab stops between columns help me place the info correctly in the merged word document).
Code:
Private Sub SendInfoToMainForm_Click()
On Error GoTo Err_SendInfoToMainForm_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Forms![CustomerForm].SubTotal.Value = [CustomerForm].Form![PartsForm].Form!OrderDetailsTotal
'Forms![CustomerForm].PartsUsed.Value = all records in the PartsForm including the subforms headers... exactly as if using CTRL+A/C/V to paste the records into the PartsUsed textbox on the CustomerForm
Exit_SendInfoToMainForm_Click:
Exit Sub
Err_SendInfoToMainForm_Click:
MsgBox Err.Description
Resume Exit_SendInfoToMainForm_Click
End Sub
________________________________________________________________
Private Sub SendInfoToMainForm_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
End Sub
The subform has OrderID, PartID, PartDescription, UnitPrice, TotalPrice (& OrderDetailsTotal in the footer).
To link the parts used for a particular customer I have the subform child link = OrderID (PartsForm) & Master
link = CustomerID (CustomerForm).
I hope I haven't confused you with my explanation to what I need help with.
I've been searching for a solution to this for weeks, can anybody here help me?... I'm a bit too novice to get my head round it

I have a form (CustomerForm) that contains general customer information with a subform (PartsForm), in datasheet view, it shows items bought by the selected customer. Now, I need to transfer the list of parts used by the particular customer into a textbox on the main form so I can merge to a word document.
So far the main form has a button that has 2 events to set the total value of parts purchased into a SubTotal textbox and this works perfectly. I don't know how to place the records in the PartsUsed texbox (please refer to the commented line in the code below for what I'm trying to achieve) and for it to work as I intend it needs to be done similar to using the CTRL+A/C/V method so i can keep the formatting (i.e. the tab stops between columns help me place the info correctly in the merged word document).
Code:
Private Sub SendInfoToMainForm_Click()
On Error GoTo Err_SendInfoToMainForm_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Forms![CustomerForm].SubTotal.Value = [CustomerForm].Form![PartsForm].Form!OrderDetailsTotal
'Forms![CustomerForm].PartsUsed.Value = all records in the PartsForm including the subforms headers... exactly as if using CTRL+A/C/V to paste the records into the PartsUsed textbox on the CustomerForm
Exit_SendInfoToMainForm_Click:
Exit Sub
Err_SendInfoToMainForm_Click:
MsgBox Err.Description
Resume Exit_SendInfoToMainForm_Click
End Sub
________________________________________________________________
Private Sub SendInfoToMainForm_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
End Sub
The subform has OrderID, PartID, PartDescription, UnitPrice, TotalPrice (& OrderDetailsTotal in the footer).
To link the parts used for a particular customer I have the subform child link = OrderID (PartsForm) & Master
link = CustomerID (CustomerForm).
I hope I haven't confused you with my explanation to what I need help with.