Hi,
I’ve got a dialog box with several fields on it, and for each I have added some code in the OnChange event to check the size of the field and report back if it’s too big. This works fine for all the fields on the dialog box, except the last one.
If I tab through each field and the contents is too big, a messagebox comes up alerting the user. When you tab out of the last field (and subsequently highlight the Ok button) the OnChange code doesn’t appear to run. The only way I can get it to run is by either tabbing though Ok and Cancel until the first field is selected again, by clicking on another field in the dialog box, or by putting another field at the end of the dialog box which is then tabbed in to. None of these solutions are desirable, does anyone know why the last exiting event isn’t triggered when you tab out of the field and on to the OK button?
I’ve just found that if you click the OK button after filling in the last field, the OnChange code is also triggered then but by that stage it’s too late to get the user to change the field contents. I know I could check the field in the QuerySave event of the dialog box and prevent it from closing with continue = false but I would rather each field behaved in the same way.
Any help with this would be greatly appreciated.