Hi all!
I have what I hope is a very simple problem!..Within my database I have an order form. This is filled out by an administrator and then a Purchase Order is raised to our suppliers. When the Purchase Order Form is opened from the Order form I use the following code to copy across some of the more important details.
Private Sub Purchase_Orders_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PurchaseOrder"
'
DoCmd.OpenForm stDocName, , , stLinkCriteria
'
[Forms]![PurchaseOrder]![EndUser] = [Forms]![Orders]![EndUser]
[Forms]![PurchaseOrder]![OrderID] = [Forms]![Orders]![OrderID]
[Forms]![PurchaseOrder]![Reseller] = [Forms]![Orders]![Reseller]
If MsgBox("Do you wish to copy the customer information from the order form?", vbYesNo, "Time to make a decision....") = vbYes Then
[Forms]![PurchaseOrder]![MemoField] = [Forms]![Orders]![InformationToAdd]
Else
[Forms]![PurchaseOrder]![MemoField] = [Forms]![PurchaseOrder]![MemoField] = False
End If
However it would also make more sense to copy over the details of the products ordered in the ‘Orders subform’ to the Purchase Order subform. As the purchase order is raised using dollars this raises a different amount from the ‘Product ID’ than on the order form (processed in sterling)..so all I figured I had to copy over from the orders subform was this Product ID.
However when I went to do this I found that it wasn’t as simple as
[Forms]![PO_Subform]![ProductID] = [Forms]![O_Subform]![ProductID]
…I kept getting errors that the form O_Subform doesn’t exist and errors such as ‘ProductID’ not recognised as I played with the problem…..
…can anyone tell me what I’m missing…as its also more than one item in ProductID would this cause a problem too?????????
Thanks so much in advance to anyone who can help.
I have what I hope is a very simple problem!..Within my database I have an order form. This is filled out by an administrator and then a Purchase Order is raised to our suppliers. When the Purchase Order Form is opened from the Order form I use the following code to copy across some of the more important details.
Private Sub Purchase_Orders_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PurchaseOrder"
'
DoCmd.OpenForm stDocName, , , stLinkCriteria
'
[Forms]![PurchaseOrder]![EndUser] = [Forms]![Orders]![EndUser]
[Forms]![PurchaseOrder]![OrderID] = [Forms]![Orders]![OrderID]
[Forms]![PurchaseOrder]![Reseller] = [Forms]![Orders]![Reseller]
If MsgBox("Do you wish to copy the customer information from the order form?", vbYesNo, "Time to make a decision....") = vbYes Then
[Forms]![PurchaseOrder]![MemoField] = [Forms]![Orders]![InformationToAdd]
Else
[Forms]![PurchaseOrder]![MemoField] = [Forms]![PurchaseOrder]![MemoField] = False
End If
However it would also make more sense to copy over the details of the products ordered in the ‘Orders subform’ to the Purchase Order subform. As the purchase order is raised using dollars this raises a different amount from the ‘Product ID’ than on the order form (processed in sterling)..so all I figured I had to copy over from the orders subform was this Product ID.
However when I went to do this I found that it wasn’t as simple as
[Forms]![PO_Subform]![ProductID] = [Forms]![O_Subform]![ProductID]
…I kept getting errors that the form O_Subform doesn’t exist and errors such as ‘ProductID’ not recognised as I played with the problem…..
…can anyone tell me what I’m missing…as its also more than one item in ProductID would this cause a problem too?????????
Thanks so much in advance to anyone who can help.