Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default First textbox in form not accepting input properly

I have a form containing three textboxes with the right adjust property
set. The first textbox is initialized with the number 12. The cursor is
blinking behind the number 12, which is not highlighted like it should
be. When I type in the number 25 the textbox shows 1225 instead of
overwriting the number 12 to get 25. There is no problem when I type in
the remaining textboxes where the existing number is highlighted and is
overwritten by the number typed in.
I’ve tried making the tabindex 0 which didn’t work. I also put a dummy
textbox or commandbutton with an tabindex of 0 in front of the leading
textbox. This worked but its dumb having to have to tab it before
entering data in the desired textbox.

How can I fix this? What is happening? Is this a bug?




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default First textbox in form not accepting input properly


What is happening is that when you set the text box value (I assume i
UserForm_Activate or UserForm_Initialize), it is acting as if the valu
was typed in (since it kind of was). To have it highlighted, you mus
highlight it:

Private Sub UserForm_Initialize()
TextBox1.Value = 12
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Text)
End Sub



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26739

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default First textbox in form not accepting input properly

I would guess this is by design. After all, if you have
initialized the value to 12, there must be a good reason
for it. Put it another way, if you wanted to change the
value as soon as the form opened, then why would you
initialize the text box to 12? The best I could do is this:
Private Sub UserForm_Initialize()
Me.TextBox1.Value = 12
Me.TextBox1.SelStart = 0
End Sub
Geof.
-----Original Message-----
I have a form containing three textboxes with the right

adjust property
set. The first textbox is initialized with the number

12. The cursor is
blinking behind the number 12, which is not highlighted

like it should
be. When I type in the number 25 the textbox shows 1225

instead of
overwriting the number 12 to get 25. There is no problem

when I type in
the remaining textboxes where the existing number is

highlighted and is
overwritten by the number typed in.
I've tried making the tabindex 0 which didn't work. I

also put a dummy
textbox or commandbutton with an tabindex of 0 in front

of the leading
textbox. This worked but its dumb having to have to tab

it before
entering data in the desired textbox.

How can I fix this? What is happening? Is this a bug?




*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default First textbox in form not accepting input properly

Way to go k!
-----Original Message-----

What is happening is that when you set the text box value

(I assume in
UserForm_Activate or UserForm_Initialize), it is acting

as if the value
was typed in (since it kind of was). To have it

highlighted, you must
highlight it:

Private Sub UserForm_Initialize()
TextBox1.Value = 12
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Text)
End Sub

K


--
kkknie
----------------------------------------------------------

--------------
kkknie's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=7543
View this thread:

http://www.excelforum.com/showthread...hreadid=267397

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default First textbox in form not accepting input properly

That did it. I'll admit I don't see why one has to go through those
extra steps but they work so lots of thanks.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
How can I have an input form to add a random no. to each input entry? saziz Excel Discussion (Misc queries) 2 January 25th 06 11:46 PM
validation of input in textbox Peer Excel Programming 3 July 23rd 04 03:06 PM
Limit input in a textbox James Agostinho Excel Programming 2 September 10th 03 03:10 PM
Textbox does not print properly Theresa[_3_] Excel Programming 0 August 4th 03 05:25 PM


All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"