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
-
X Suspends Encrypted DMs
by
Alex5723
34 minutes ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
52 minutes ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
1 hour, 29 minutes ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 hours, 6 minutes ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 hour, 29 minutes ago -
Enabling Secureboot
by
ITguy
5 hours, 16 minutes ago -
Windows hosting exposes additional bugs
by
Susan Bradley
10 hours ago -
No more rounded corners??
by
CWBillow
5 hours, 49 minutes ago -
Android 15 and IPV6
by
Win7and10
11 hours, 6 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
22 hours, 21 minutes ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
1 day, 1 hour ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
19 hours, 37 minutes ago -
Windows Update orchestration platform to update all software
by
Alex5723
1 day, 8 hours ago -
May preview updates
by
Susan Bradley
19 hours, 45 minutes ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
11 hours, 20 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
1 day ago -
KB5058379 / KB 5061768 Failures
by
crown
21 hours, 38 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
39 minutes ago -
At last – installation of 24H2
by
Botswana12
1 day, 23 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
10 hours, 56 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
2 days, 12 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
10 hours, 32 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
3 days, 1 hour ago -
Another test post
by
gtd12345
3 days, 1 hour ago -
Connect to someone else computer
by
wadeer
2 days, 20 hours ago -
Limit on User names?
by
CWBillow
2 days, 23 hours ago -
Choose the right apps for traveling
by
Peter Deegan
2 days, 13 hours ago -
BitLocker rears its head
by
Susan Bradley
1 day, 21 hours ago -
Who are you? (2025 edition)
by
Will Fastie
1 day, 20 hours ago -
AskWoody at the computer museum, round two
by
Will Fastie
2 days, 15 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.