mdschuetz
Nerd Incognito
- Local time
- Today, 13:33
- Joined
- Oct 31, 2007
- Messages
- 49
I need some advice.
In my database I have a form.
The form holds a subform.
The form is tied to tblPurchaseOrders.
The subform is tied to tblInventoryTransactions
Inventory transactions captures specific information related to each purchase order such as quantity ordered, quantity received, part number ect...
Now the goal is to order and receive products using frmPurchaseOrder.
I've created two command buttons.
btn1 exports form and subform data to an excel file which is a template for a physical purchase order.
btn2 exports form and subform data to an excel file which is a template for a physical recieving document.
I am having difficulty in getting the subform data I desire into the btn2template properly. It posts all the data, when I just want the items received to populate.
The subform is a datasheet.
I doubt this is enough information to get any advice on. Anyone wanna see if they can help me with this? I sure would appreciate any advice.
Here is the code for my command button. This may help you understand what I am doing.
Marty
In my database I have a form.
The form holds a subform.
The form is tied to tblPurchaseOrders.
The subform is tied to tblInventoryTransactions
Inventory transactions captures specific information related to each purchase order such as quantity ordered, quantity received, part number ect...
Now the goal is to order and receive products using frmPurchaseOrder.
I've created two command buttons.
btn1 exports form and subform data to an excel file which is a template for a physical purchase order.
btn2 exports form and subform data to an excel file which is a template for a physical recieving document.
I am having difficulty in getting the subform data I desire into the btn2template properly. It posts all the data, when I just want the items received to populate.
The subform is a datasheet.
I doubt this is enough information to get any advice on. Anyone wanna see if they can help me with this? I sure would appreciate any advice.
Here is the code for my command button. This may help you understand what I am doing.
Code:
Dim objXxL As Excel.Application
Dim objWxB As Excel.Workbook
Dim objWxS As Excel.Worksheet
Set objXxL = Excel.Application
Set objWxB = objXxL.Workbooks.Open("\\mypath.xls")
Set objWxS = objWxB.Worksheets("Form")
With objWxS
.Cells(6, 3).Value = Me.txtTD
.Cells(13, 13).Value = Me.txtYes
.Cells(13, 16).Value = Me.txtNo
.Cells(10, 4).Value = Me.PurchaseOrderNumber
.Cells(8, 3).Value = Me.cboSupplierID.Column(1)
.Cells(8, 19).Value = Me.cboAccount.Column(1)
.Cells(10, 9).Value = Me.cboPJO.Column(1)
.Cells(13, 31).Value = Me.cboInspect.Column(0)
Dim xx As Integer
xx = 38
[Purchase Orders Subform].Form.Recordset.MoveFirst
While Not [Purchase Orders Subform].Form.Recordset.EOF
.Cells(xx, 2).Value = [Purchase Orders Subform].Form!UnitsRecieved
.Cells(xx, 4).Value = [Purchase Orders Subform].Form!PartNumber & " -" & [Purchase Orders Subform].Form!ItemDescription
.Cells(xx, 15).Value = [Purchase Orders Subform].Form!UnitPrice
[Purchase Orders Subform].Form.Recordset.MoveNext
xx = xx + 1
Wend
End With
objXxL.Visible = True
End Sub
Last edited: