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

Setting focus to control after navigating to next record...

P: 3
My Access DB has a main data entry form. There are so many fields on the form that I've added a vertical scroll bar. When my cursor is in a text box near the bottom of the form and click on the navigation button to go to the next record, that same text box still has focus and all of the text in the next record is selected. To view the top of the form, I now have to scroll up.

What I want to have happen is this:
I click on the navigation button to show the next record and focus is placed on a control at the top of the form which, in effect, will scroll the form up for me...

But I can't find a click event for the parts of the navigation buttons so I can set focus to the control I want for that event.... how to do this....?
Barry
Oct 4 '07 #1
Share this Question
Share on Google+
3 Replies


missinglinq
Expert 2.5K+
P: 3,532
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   NameOfControlToGetFocus.SetFocus
  3. End Sub
Welcome to TheScripts!

Linq ;0)>
Oct 4 '07 #2

P: 3
Nevermind... I found out how...
I went to the OnCurrent event for the form and set the focus to the proper control there...
Oct 4 '07 #3

P: 3
Nevermind... I found out how...
I went to the OnCurrent event for the form and set the focus to the proper control there...
Yup! That's how I did it... Thanks anyway... and thanks for the very quick reply! I'll be back here again I'm sure...

Barry
Oct 4 '07 #4

Post your reply

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