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.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
1 hour, 10 minutes ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 hours, 52 minutes ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
6 hours, 38 minutes ago -
Windows Update orchestration platform to update all software
by
Alex5723
11 hours, 11 minutes ago -
May preview updates
by
Susan Bradley
12 hours, 49 minutes ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
45 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
3 hours, 22 minutes ago -
KB5058379 / KB 5061768 Failures
by
crown
27 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
30 minutes ago -
At last – installation of 24H2
by
Botswana12
1 day, 2 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
17 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
1 day, 14 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
1 day, 8 hours ago -
Limited account permission error related to Windows Update
by
gtd12345
2 days, 4 hours ago -
Another test post
by
gtd12345
2 days, 4 hours ago -
Connect to someone else computer
by
wadeer
1 day, 22 hours ago -
Limit on User names?
by
CWBillow
2 days, 2 hours ago -
Choose the right apps for traveling
by
Peter Deegan
1 day, 15 hours ago -
BitLocker rears its head
by
Susan Bradley
23 hours, 55 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
22 hours, 52 minutes ago -
AskWoody at the computer museum, round two
by
Will Fastie
1 day, 18 hours ago -
A smarter, simpler Firefox address bar
by
Alex5723
2 days, 14 hours ago -
Woody
by
Scott
3 days ago -
24H2 has suppressed my favoured spider
by
Davidhs
23 hours, 32 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
3 days, 14 hours ago -
MS Office 365 Home on MAC
by
MickIver
3 days, 8 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
4 days, 4 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
23 hours, 17 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days, 23 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days, 23 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.