In my code after I made the alterations to the new form I only had the below code to Extract the exchange rate
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenQuery "Clear Transactions - Procurement - Temp", acViewNormal, acEdit
DoCmd.OpenQuery "Clear Transactions - Procurement - Temp - Header", acViewNormal, acEdit
DoCmd.OpenQuery "Update Transactions - Procurement Temp from Procurement - Header"
DoCmd.OpenQuery "Update Transactions - Procurement Temp from Procurement - Detail"
Me.Parent!txtExchange = ToUGX(Me.Parent!txtDate, Me.Parent!Currency)
DoCmd.OpenQuery "Update Transactions - Procurement - Temp - Last Purchase Price"
Forms![PurchaseOrder_Order].Form.Requery
Forms![PurchaseOrder_Order]![PurchaseOrderOrderSubForm].Form.Requery
When I looked at the sample arnelgp provided, I noticed that I did not requery the main form after I have updated the required date to enable the code to run for extracting the exchange rate
I infarct made a few attempts to equerry the form but it was inadecuite
below is the code I ended up with which made a huge difference, thanx to arnelgp
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenQuery "Clear Transactions - Procurement - Temp", acViewNormal, acEdit
DoCmd.OpenQuery "Clear Transactions - Procurement - Temp - Header", acViewNormal, acEdit
DoCmd.OpenQuery "Update Transactions - Procurement Temp from Procurement - Header"
DoCmd.OpenQuery "Update Transactions - Procurement Temp from Procurement - Detail"
Me.Parent.Requery
'DoCmd.Close
If Me.Parent!Currency & "" <> "UGX" Then
Me.Parent.txtExchange = ToUGX(Me.Parent.txtDate, Me.Parent.Currency & "")
Else
Me.Parent.txtExchange = 1
End If
DoCmd.OpenQuery "Update Transactions - Procurement - Temp - Last Purchase Price"
Forms![PurchaseOrder_Order].Form.Requery
Forms![PurchaseOrder_Order]![PurchaseOrderOrderSubForm].Form.Requery
So the original code works as expected, after I made the change on the new form, I did not put all my sequences in place to prepare for the code to run successfully.
To all of you, every time I have an issue, I do learn quite a bit from all the comments' and I thank you for that.