I have successfully captured events on PMCOSTH and PMCOSTD. but there is this Detail/Tax button where you don't have to use the grid.
And I want to put an edit on the CATEGORY field on the non-grid window; have it working on the grid window
Public WithEvents dsPMCostH As AccpacPM2010.ACCPACDSControlPublic WithEvents dsPMCostD As AccpacPM2010.ACCPACDSControl
Public WithEvents dsPMCostD2 As AccpacPM2010.ACCPACDSControl ****
Set dsPMCostD2 = AccpacPM2010UICtrl1.UIDSControls("dsPMSUP") ****
this part below does not work; I suspect that at least the Set command above needs some kind of nested reference as I am not seeing any events.
Private Sub dsPMCostD2_OnRecordChanging
Any pointers would help; otherwise I will capture the POST button on the main screen and edit there - but prefer to edit the FieldChange on the non-grid window
Thanks as always
I think you're refering to the popup window. The main UI will have an OnPopup event. In that event you're passed the data sources used on the popup window. You can connect the data source variables from the popup to your main data source variables and in the OnPopup Closed event (I can't remember the name of the event) you can restore the data source variables back to the main UI's data sources.
You also have access to the array of controls on the popup in that event so you can do what you need to there.
thanks, I wondered if it was a pop-up; instead of a dynamically invoked form.
I also put a 'scan all detail lines' in the POST event of the header; so they won't get away with the bad input
I will play more
Strange RVSPY shows the popup is running under the detail view but it does not make an event for the detail view.
Sage magic at work.
With regards to traversing through records of a data source connected to a grid you need to set the data source's FireEvents to False otherwise you can run into trouble. Do your loop and then set FireEvents to True.
thanks, Yeah I have noticed that where while you are inside the event sometimes by accessing the detail lines you actually fire the event . I usually just make a public variable like 'DoingCalculations = true and the first line in the event is "If DoingCalculations then exit sub"
Followup on Popup sub window, I saw some dialog of yours with Microtek
Private Sub AccpacUI_OnPopupOpened(ByVal strPopupName As String, PopupDSs As AccpacPO1310.ACCPACDSControls, PopupCtls As AccpacPO1310.ACCPACControls, strPopupCaption As String, icoPopup As stdole.Picture) If strPopupName = "DetailEntryZoom" Then Set dsDetail = Nothing Set dsPopupDetail = PopupDSs.Item("dsPORCPL") End If
PJC Cost Entry screen report PopupDCSs.count=0; so I guess it is just a big form and they use the ADD button to put the line on the grid.
APInvoice Entry screen reports PopupDCSs.count=4 and yes one of them is dsAPIBD; but guess what it only 'evented' when I closed the Popup window.
Maybe I will run a quick test and see if a field change on the PopUp window field (PopupCtls) will 'Event'