Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update while typing in Access97

Status
Not open for further replies.

py7jcn

Programmer
Feb 15, 2002
2
GB
I want a text control to update while the user is typing so that I can make a form similar to the Index tab on Windows help.

It seems sensible to use the 'On Key Press' event, but I can't get it to update the control's value until the user presses enter. If anyone knows how to do this, please let me know.
 
The OnChange event triggers each time a key is pressed.

mac
 
The On Change event is indeed triggered each time a key is pressed along with a few other events, but the problem is that the control's value isn't updated until the user presses enter or the carat leaves the control. The only solution I can think of is to parse each individual keypress's ASCII code and store the result in a hidden control but I can't help but think there must be a more elegant solution - does anyone know of one?
 
I think you are using the default property of the control, try using the .text property. If you compare it with the .value property or the default property you will find them to differ as you type. for instance:

dim ctl as textbox
set ctl = me.text1
debug.print ctl
debug.print ctl.text

set ctl=nothing

Dexter Macrame
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top