Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default keypress event on a userform

Hello everyone,



So far I've managed to get a textbox updated when typing characters in
another textbox. Unfortunately, there are drawbacks that I can't get rid of.
Maybe someone can help me.



Textbox: tbNumber

This textbox is part of the source for the textbox that follows shortly.
When typing a number into tbNumber, I want that number to become visible in
the tbReference textbox with each character has just been typed.



Textbox: tbReference

The text in this textbox is a string variable consisting of a standard text
combined with a word that is put in the variable based on the selection of 1
of 2 option buttons and the number typed in tbNumber.




Things that work and things that do not (yet?) work:

When starting to type something into tbNumber the first character appears
only after the second one is typed.

Another thing that does not (yet?) work is pressing "backspace" to delete
the last character.

And choosing the other option does not cause immediate adjustment of the
string shown in tbReference.



Maybe someone knows how to handle this.



Greetings,

Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default keypress event on a userform

have you got some code to share?

--
HTH

Bob Phillips

"Peter" wrote in message
...
Hello everyone,



So far I've managed to get a textbox updated when typing characters in
another textbox. Unfortunately, there are drawbacks that I can't get rid

of.
Maybe someone can help me.



Textbox: tbNumber

This textbox is part of the source for the textbox that follows shortly.
When typing a number into tbNumber, I want that number to become visible

in
the tbReference textbox with each character has just been typed.



Textbox: tbReference

The text in this textbox is a string variable consisting of a standard

text
combined with a word that is put in the variable based on the selection of

1
of 2 option buttons and the number typed in tbNumber.




Things that work and things that do not (yet?) work:

When starting to type something into tbNumber the first character appears
only after the second one is typed.

Another thing that does not (yet?) work is pressing "backspace" to delete
the last character.

And choosing the other option does not cause immediate adjustment of the
string shown in tbReference.



Maybe someone knows how to handle this.



Greetings,

Peter




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default keypress event on a userform

Yes I do. Here it is. (BTW Sorry to not include it in my first post)



<Beginning of code in the module for the Userform

Option Explicit

Const CONCERNING As String = "Concerning: "

Const OPTIONBUTTON1TXT As String = "optionbutton 1 text "

Const OPTIONBUTTON2TEXT As String = "optionbutton 2 text "

Dim sConcerning As String




Private Sub tbNumber_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

If obOptionButtonOne Then

sConcerning = CONCERNING & OPTIONBUTTON1TXT & tbNumber

Else

sConcerning = CONCERNING & OPTIONBUTTON2TXT & tbNumber

End If

tbReference = sConcerning

End Sub



Private Sub obOptionBttn1_Click()

sConcerning = CONCERNING & OPTIONBUTTON1TXT & tbNumber

tbNumber.SetFocus

End Sub



Private Sub obOptionBttn2_Click()

sConcerning = CONCERNING & OPTIONBUTTON2TXT & tbNumber

tbNumber.SetFocus

End Sub



<End of code



Greetings,

Peter


"Bob Phillips" schreef in bericht
...
have you got some code to share?

--
HTH

Bob Phillips

"Peter" wrote in message
...
Hello everyone,



So far I've managed to get a textbox updated when typing characters in
another textbox. Unfortunately, there are drawbacks that I can't get rid

of.
Maybe someone can help me.



Textbox: tbNumber

This textbox is part of the source for the textbox that follows shortly.
When typing a number into tbNumber, I want that number to become visible

in
the tbReference textbox with each character has just been typed.



Textbox: tbReference

The text in this textbox is a string variable consisting of a standard

text
combined with a word that is put in the variable based on the selection
of

1
of 2 option buttons and the number typed in tbNumber.




Things that work and things that do not (yet?) work:

When starting to type something into tbNumber the first character appears
only after the second one is typed.

Another thing that does not (yet?) work is pressing "backspace" to delete
the last character.

And choosing the other option does not cause immediate adjustment of the
string shown in tbReference.



Maybe someone knows how to handle this.



Greetings,

Peter






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
Getting KeyPress Event to work Pete Excel Programming 2 November 9th 04 08:25 PM
How can I make cell keypress event? No Name Excel Programming 0 September 13th 04 12:28 PM
Keypress Event R Avery Excel Programming 2 August 4th 04 03:51 PM
Trap CTRL+C keypress event Nick Excel Programming 4 January 30th 04 09:17 PM
KeyPress Event Conrado Capistrano Excel Programming 4 September 25th 03 05:27 AM


All times are GMT +1. The time now is 02:56 PM.

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

About Us

"It's about Microsoft Excel"