Solved

AutoTab-ing

Posted on 1997-08-01
2
186 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
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
ESI earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help in WHSCRIPT 9 47
VB 6.0 printer how to align 6 58
Adding to a VBA? 6 62
MS Date Picker 64 bit 32 bit issue 12 49
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now