Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 17th, 2008, 11:59 PM
Authorized User
 
Join Date: Jun 2008
Location: sydney, nsw, Australia.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mona_upm84
Default Move cursor to specific textbox

Hi all,

How can i make sure the cursor from textbox A go to textbox C, not textbox B? In every textbox of my userform, there is a procedure where textbox will be disabled once data entered, to make sure no alteration.

But after entered current textbox, the cursor jump to other textbox randomly. I got more than 50 textboxes in one form and this will annoy user everytime they want to key in data. I need it to move to the next textbox automatically after user press "Enter" button on keyboard, so that user can enter next data easily, without have to click with mouse.

Any help are most welcome....

Thanks!!

Reply With Quote
  #2 (permalink)  
Old July 18th, 2008, 07:56 AM
Friend of Wrox
Points: 2,950, Level: 22
Points: 2,950, Level: 22 Points: 2,950, Level: 22 Points: 2,950, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 788
Thanks: 1
Thanked 51 Times in 47 Posts
Default

Hi

The easiest way is to set the TabIndex of the Textboxes in sequence (1, 2,3..).

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Reply With Quote
  #3 (permalink)  
Old July 29th, 2008, 07:06 PM
Authorized User
 
Join Date: Jun 2008
Location: sydney, nsw, Australia.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mona_upm84
Default

Hi shasur,

thanks for replied. The cursor did not move to the next textbox even when i set those textboxes according to 1,2,3.....

this is because i set those textboxes to be disabled whenever user enter data once, this is for data integrity issue. so i found out another way to make sure the cursor move the next textbox which is by using 'setfocus.'


For example from textbox1 to textbox to:

Private Sub TextBox1_Change()
If Me.TextBox1.Text = "" Then
   Me.TextBox1.Enabled = True
Else
   Me.TextBox1.Enabled = False
   Me.TextBox2.SetFocus
End If
End Sub


With this 'SetFocus', cursor will move to the specified textbox. Hope this helps other friends who faced with this problem as well....

Cheers,
Mona

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move cursor to specific textbox mona_upm84 Excel VBA 0 September 29th, 2008 09:35 PM
Javascript to move cursor frm one textbox to othr lakshmi_annayappa Javascript 1 July 23rd, 2007 05:16 AM
Move image when cursor approaches sanjana Pro Visual Basic 2005 1 July 19th, 2007 04:55 PM
Move cursor to beginning of field in form Odeh Naber Access 3 June 5th, 2007 04:21 PM
how shall I move the cursor? nerssi Javascript 0 September 21st, 2004 09:27 AM



All times are GMT -4. The time now is 02:01 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.