?
Solved

AutoTab-ing

Posted on 1997-08-01
2
Medium Priority
?
192 Views
Last Modified: 2012-06-27
I need to know how to get text boxes to AutoTab to the next one in the order when each one has been filled. I know how to do this when designing a form in Access, but can't seem to find the same facilities in VB. I guess I could write code for this, but I was wondering if there was a quicker way.
0
Comment
Question by:nsmith080197
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
ESI earned 150 total points
ID: 1429179
Unless U have the new MS Forms 2.0 Controls Library (the new controls provided have an AutoTab property), u'll have to write some lines of code in the KeyPress event :

Private Sub txtDate_KeyPress (KeyAscii As Integer)
   If KeyAscii = vbKeyReturn Then ' Enter pressed
          KeyAscii = 0     ' Trap it !
          SendKey "{TAB}"   ' Go to next field (next TabIndex value to be more accurate)
   End If
End Sub

Another possibility is to count the number of given characters before performing the "AutoTab" if you know the user must always enter a certain number of chars or digits in a given field.

Well, hope it helps, & happy programming,
L8r
0
 
LVL 3

Expert Comment

by:ESI
ID: 1429180
Replace "SendKey" with "SendKeys" please.....
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question