Chris,
One more thing. I noticed earlier in the thread it appears you want to set focus to a particular control on the form...and I assume you want the most recent. Instead of storing the name of the control in a string, you can store a reference to the control in a property of the form.
For example, in the lostfocus() of the controls on your form:
thisform.currentControl = this
Then, in your form's queryunload(), if you are going to keep the form open you simply:
thisform.currentControl.setfocus()
Of course you can add code to your custom classes so you don't have to add code to the lostfocus() method of every control on your forms...
HTH,
steve
>Yep that's the idea - they can flick about opening one form after another (when each form opens I store away it's name and when another form is launched I first programmatically close the previous form...) the idea is that in the lost focus I detect any changes made and trap the user on the form.
>
Steve Gibson