I have a datawindow where users can edit data and then click a 'Save' button. I've coded the ItemChanged
event on the datawindow to store the old and new values in instance variables so that they can be saved in the database for reference. If the user edits a field in the DW and doesn't tab out, ItemChanged
does not get called. So if they enter the data and immediately click 'Save', the instance variables are not getting populated.
I'm calling AcceptText
as the first thing in the 'Save' button, which is supposed to get all the entered data in the DW and call ItemChanged
(according to PB help). But it's not. What's weird is that it appears to be going through all the code in the 'Save' button and THEN going through the code in the ItemChanged
event.
Another weird thing is if I debug it and put a breakpoint in the ItemChanged
event, when I click 'Save' it will go through the ItemChanged
code, but it won't do the 'Save' button code. I have to click 'Save' a second time. That's ONLY when I debug and ONLY if I have a breakpoint there - when I run the application normally or in debug without a breakpoint, it calls ItemChanged
after the Save button.
I've never seen anything like this, so I'd appreciate any advice you can offer. Thanks!