473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Automatically advance to next textbox

Gil
I am trying to advance to the next textbox when input for the current textbox
has reached its maximum length. In a different newsgroup I found this code
snipit, but I have not been able to use it.

Private Sub Text1_Change()
If Len(Me.Text1) = Me.Text1.MaxLength Then
Me.Text2.SetFocus
End If
End Sub

I use VS to program in VB.net, and this is for an aspx web page. The
problem is that SetFocus is not a member of
system.web.ui.webcontrols.textbox. I also tried 'focus', also to no avail.

TIA
Gil
Nov 22 '05 #1
1 2165
Remember that you are using a Server side control for this so the event
sequences and behavior are a weee bit different than they are in a Winforms
app. This however should help you
http://support.microsoft.com/default...b;EN-US;316719

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Gil" <Gi*@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
I am trying to advance to the next textbox when input for the current textbox has reached its maximum length. In a different newsgroup I found this code snipit, but I have not been able to use it.

Private Sub Text1_Change()
If Len(Me.Text1) = Me.Text1.MaxLength Then
Me.Text2.SetFocus
End If
End Sub

I use VS to program in VB.net, and this is for an aspx web page. The
problem is that SetFocus is not a member of
system.web.ui.webcontrols.textbox. I also tried 'focus', also to no avail.
TIA
Gil

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gil | last post by:
I am trying to advance to the next textbox when input for the current textbox has reached its maximum length. In a different newsgroup I found this code snipit, but I have not been able to use it....
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
21
by: Simon Verona | last post by:
Hope somebody can help! I want to automatically be able to add code to the initialize routine on a Windows form when I add a custom control that I've written to a form. Specifically, I'm trying...
0
by: fds | last post by:
Hello! I have a very specific question and that is about how to inherit a control for example the control System.Windows.Forms.TextBox without causing the environment to delete the control when...
5
by: BLACKDOG157 | last post by:
I've made a form with a variable number of textboxes. The user fills them out, and then I need to pick up the values he has filled in. The number of textboxes vary depending on a value that the...
2
Frinavale
by: Frinavale | last post by:
Hi there! I'm trying to write a simple JavaScript that will move the cursor to the next TextBox after 5 characters (or numbers) have been entered. I'm attempting to get this working in all...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
6
by: Chris | last post by:
Hi, When the length of a textbox in a form exceeds the length of the corresponding field, i get an error message ("string or binary data will be truncated .... ") and the aplication stops. I...
1
by: postman | last post by:
In Access 2007, I'm using bound textboxes on a continuous form to display the contents of each record's memo field. Is there a way to automatically adjust the textbox height to fit the contents? ...
5
by: jazznojive | last post by:
I've created a textbox control on a userform and I am trying to figure out how to make the text populate to a worksheet range in sequence automatically. I've figued out how to get the text that the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.