I am using MsgBox to try and validate data on a form.
If the textbox is empty MsgBox displays an error message and beeps. This bit works OK, whether I invoke it on the lost focus or exit event.
However, I can not get the focus to return the the text box which needs validating after the msgbox.
What am I doing wrong?
I've tried putting a setfocus both before and after the msgbox, but this fails. I've tried using VBA and just in macro form (which I then converted to VBA).
It would help if I could use the debugger to trace what is happening, as it's underlying causes I want to cure not just symtoms like this.
Would it have anything to do with the fact that the tab order means that the next box after the textbox I'm validating is the first box in a subform? Is the focus getting stuck in the subform?
Insights appreciated.
If the textbox is empty MsgBox displays an error message and beeps. This bit works OK, whether I invoke it on the lost focus or exit event.
However, I can not get the focus to return the the text box which needs validating after the msgbox.
What am I doing wrong?
I've tried putting a setfocus both before and after the msgbox, but this fails. I've tried using VBA and just in macro form (which I then converted to VBA).
It would help if I could use the debugger to trace what is happening, as it's underlying causes I want to cure not just symtoms like this.
Would it have anything to do with the fact that the tab order means that the next box after the textbox I'm validating is the first box in a subform? Is the focus getting stuck in the subform?
Insights appreciated.