hoochiepoos
New member
- Local time
- Today, 21:48
- Joined
- Dec 12, 2018
- Messages
- 8
Hi,
I am trying to duplicate some data to avoid aching fingers. The data would be modified on the purchasing form so it is not true data duplication.
The structure is as follows:
Form for internal use = frmSparesProcessing
subform = frmSubSparesDetail
Form for External use = PurchaseOrderform
subform =OrderDetailsSubform
I have managed to populate the PurchaseOrderform form but only 1 record comes over from frmSubSparesDetail and is inserted into OrderDetailsSubform.
I am a beginner at VBA and I appreciate your kind help.
I am trying to duplicate some data to avoid aching fingers. The data would be modified on the purchasing form so it is not true data duplication.
The structure is as follows:
Form for internal use = frmSparesProcessing
subform = frmSubSparesDetail
Form for External use = PurchaseOrderform
subform =OrderDetailsSubform
I have managed to populate the PurchaseOrderform form but only 1 record comes over from frmSubSparesDetail and is inserted into OrderDetailsSubform.
I am a beginner at VBA and I appreciate your kind help.
Code:
Private Sub btnSupplierOrder_Click()
If Not IsNull(Me![EnquiryNo]) Then
DoCmd.OpenForm "PurchaseOrdersForm"
DoCmd.GoToRecord , , acNewRec
Forms![PurchaseOrdersForm]![CompanyID] = Me![cboSupplierCompany]
Forms![PurchaseOrdersForm]![OrderInitials] = Me![cboEmployeeID]
Forms![PurchaseOrdersForm]![JobNumber] = DLookup("[Job Ref]", "[qryMachineRegisterJob]")
Forms![PurchaseOrdersForm]![SalesPerson] = Me![cboSupplierEmployee]
Dim rs As DAO.Recordset
Forms.PurchaseOrdersForm.SetFocus
Set rs = Me.frmSubSparesDetail.Form.Recordset
rs.MoveFirst
Do While Not rs.EOF()
With rs
Forms![PurchaseOrdersForm]![OrderDetailsSubform].Form.ItemDescription = rs!Description
.MoveNext
End With
Loop
rs.MoveFirst
Set rs = Nothing