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

Command Buttons to bring user back to top of current form

P: 48
Hi byters . Some of the forms Im creating contain full computer specifications and as a result are very long. Im trying to put a a command button at the bottom of these forms that returns the user to the top of the current form when clicked. Is this possible? I cant find any macros that facilitates this . Any pointers would be greatly appreciated.
Apr 14 '08 #1
Share this Question
Share on Google+
5 Replies


MindBender77
100+
P: 234
Hi byters . Some of the forms Im creating contain full computer specifications and as a result are very long. Im trying to put a a command button at the bottom of these forms that returns the user to the top of the current form when clicked. Is this possible? I cant find any macros that facilitates this . Any pointers would be greatly appreciated.
Just a thought, panteraboy. You might want to trying putting a colorbox at the top of your form, making its backcolor and border transparent. In the OnClick event of you command button, you could set the focus to that colorbox. This is untested but, it might be worth a try.

Bender
Apr 14 '08 #2

missinglinq
Expert 2.5K+
P: 3,532
Bender has the right idea, but why add a control just for this purpose? Just set focus to the first control at the top of your form:

Private Sub GoToTop_Click()
Me.FirsrtField.SetFocus
End Sub

Linq ;0)>
Apr 15 '08 #3

ADezii
Expert 5K+
P: 8,597
Hi byters . Some of the forms Im creating contain full computer specifications and as a result are very long. Im trying to put a a command button at the bottom of these forms that returns the user to the top of the current form when clicked. Is this possible? I cant find any macros that facilitates this . Any pointers would be greatly appreciated.
There is a very simple Method designed specifically for what you are describing, namely, the GoToPage Method. This Method moves the Focus to the 1st Control on a specified Page in the Active Form. In your case, place the following line of code in the Click() Event of your Command Button:
Expand|Select|Wrap|Line Numbers
  1. Me.GoToPage 1
Apr 15 '08 #4

P: 48
Thanks alot guys yes are a great help and good teachers. Thanks again
Apr 15 '08 #5

missinglinq
Expert 2.5K+
P: 3,532
That's why we're here!

Linq ;0)>
Apr 15 '08 #6

Post your reply

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