I am running Access2000 under Windows Me. I have defined an Access form for data input to a simple table and am writing VBA code for execution at various event conditions (e.g. Form_BeforeUpdate, etc.). As is normal, the movement of focus through the input fields (Text Box controls) is controlled by their Tab Index and Tab Stop properties. Elsewhere on the form are buttons that can be clicked at any time, that is, while any of the input fields is in focus. What the buttons do has no affect on the input process and so is irrelevant. My Problem: when one of the buttons is clicked, focus in all input fields is lost. To continue input I have to manually click the desired field. I want, at the end of the clicked button’s routine, to automatically return focus to either 1) the input field that was in focus or 2) the next field in the Tab Index sequence. (How to determine which is my problem.) What VBA command(s) can I use to return focus? Thanks for help.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Access2000 Form VBA Focus
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Access2000 Form VBA Focus
- This topic has 5 replies, 3 voices, and was last updated 24 years, 1 month ago.
AuthorTopicJohn Littell
AskWoody PlusApril 11, 2001 at 5:04 pm #354926Viewing 1 reply threadAuthorReplies-
WSrory
AskWoody Lounger -
John Littell
AskWoody Plus
-
-
WSKevin
AskWoody LoungerApril 11, 2001 at 6:05 pm #522545In the On Enter event for each textbox control set the tag property of the form to the control’s tab index plus 1 (the next control you want to have focus).
On Enter event of each txtbox:
me.tag = txtBox1.tabindex +1In the Clicked event of each cmdbutton:
Private Sub cmdClose_Click() Dim aTxtBox As Control 'On Error Resume Next MsgBox "The next current control is: " & Me.Tag For Each aTxtBox In Me.Controls If TypeOf aTxtBox Is TextBox Then Debug.Print aTxtBox.Properties.Item("Name") If aTxtBox.Properties.Item("TabIndex") = Me.Tag Then aTxtBox.SetFocus Exit For End If End If Next End Sub
-
John Littell
AskWoody Plus -
WSKevin
AskWoody Lounger
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 7 ISO /Windows 10 ISO
by
ECWS
4 hours, 35 minutes ago -
No HP software folders
by
fpefpe
5 hours, 20 minutes ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
24 minutes ago -
Stay connected anywhere
by
Peter Deegan
10 hours, 43 minutes ago -
Copilot, under the table
by
Will Fastie
1 hour, 56 minutes ago -
The Windows experience
by
Will Fastie
16 hours, 57 minutes ago -
A tale of two operating systems
by
Susan Bradley
7 hours, 53 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
22 hours, 17 minutes ago -
Where’s the cache today?
by
Up2you2
1 day, 13 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
1 day, 6 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
6 hours, 43 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
1 day, 14 hours ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
2 days, 6 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
2 days, 6 hours ago -
regarding april update and may update
by
heybengbeng
2 days, 8 hours ago -
MS Passkey
by
pmruzicka
1 day, 10 hours ago -
Can’t make Opera my default browser
by
bmeacham
2 days, 16 hours ago -
*Some settings are managed by your organization
by
rlowe44
2 days, 2 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
2 days, 15 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
3 days, 10 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
3 days, 19 hours ago -
AI slop
by
Susan Bradley
1 day, 13 hours ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
3 days, 21 hours ago -
Two blank icons
by
CR2
1 day, 5 hours ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 7 hours ago -
End of 10
by
Alex5723
4 days, 8 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
3 days, 6 hours ago -
test post
by
gtd12345
4 days, 14 hours ago -
Privacy and the Real ID
by
Susan Bradley
4 days, 4 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
2 days, 7 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.