By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,789 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

SetFocus after Cancel in BeforeUpdate

P: 1
I am checking for null fields in a BeforeUpdate event handler. If I find one, I set Cancel=True, set the focus for the empty text box and exit the event handler. When I return to the form, there is no focus at all. If I press the Tab key, nothing happens. I need to click in a text box to re-establish the focus.

I get to the BeforeUpdate Event handler by clicking an AddRecord button which is attempting to execute a GoToRecord acNewRec statement, placed there by the wizard that generated the code for the button. I get the impression that this statement is somehow canceling my setfocus, even though the action has been canceled.

Is there any way that I can programmatically set the focus?
Aug 13 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,206
You have posted your question in the Articles section rather than the Forum section.

I have moved it across for you.

Aug 13 '07 #2

Expert 2.5K+
P: 3,532
We need to see the entire BeforeUpdate sub.

Welcome to TheScripts!

Linq ;0)>
Aug 13 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.