So I've got a form set up like this:
~ There's a dropdown box that gives you options from a table to choose from.
~ There's a 'Jump' button to click so that if the option you want isn't listed you can jump to the appropriate form, add a new record, and then come back.
~ The dropdown, which gets the focus whenever the form is opened, has code in its OnExit event to see if it has anything in it. If not (and this isn't a new record), the user gets a message asking if they really want to leave it blank - if yes they continue, if no the Exit of the control is cancelled.
The problem is that if the user is on the dropdown and clicks the button to add a new option, they go through the OnExit event and get the message, which is frustrating when you're clicking the button in order to sort it out!
So, is there any way to tell, when they try to exit the dropdown, that they're going to the button?
Ideally, this doesn't involve code on the button and a public variable to see what the last control was, as I'd then need to add code to the other 40+ controls on the screen.
I know Access may not let you do this. Any thoughts are appreciated!
~ There's a dropdown box that gives you options from a table to choose from.
~ There's a 'Jump' button to click so that if the option you want isn't listed you can jump to the appropriate form, add a new record, and then come back.
~ The dropdown, which gets the focus whenever the form is opened, has code in its OnExit event to see if it has anything in it. If not (and this isn't a new record), the user gets a message asking if they really want to leave it blank - if yes they continue, if no the Exit of the control is cancelled.
The problem is that if the user is on the dropdown and clicks the button to add a new option, they go through the OnExit event and get the message, which is frustrating when you're clicking the button in order to sort it out!
So, is there any way to tell, when they try to exit the dropdown, that they're going to the button?
Ideally, this doesn't involve code on the button and a public variable to see what the last control was, as I'd then need to add code to the other 40+ controls on the screen.
I know Access may not let you do this. Any thoughts are appreciated!