Text box characters remaining countdown

  • Thread starter Thread starter Robin9876
  • Start date Start date
R

Robin9876

On an access form I have a textbox which I need to countdown how many
characters are available taking the length from a 100. I have put the
code in the textbox keypress event.

It updates on the first key press but subsequent key presses do fire
this event but does not update the value as it has not recognised that
the additional key in the textbox.

How can you get the character countdown to work on each key press in
the textbox?
 
Use the Change event of the text box. It fires after every keystroke.

Me.txtCountDown = 100 - Len(Me.SomeTextBox)
 
It is firing every keystroke but it does show the additional key value
that has been pressed and therefore not updating the value.
 
I don't understand what you mean by this statement:
it does show the additional key value that has been pressed
 
I don't understand what you mean by this statement:
it does show the additional key value that has been pressed

You have to use the text property of the textbox to retrieve the
current value - the value property isn't committed until the user
leaves the control.

-- James
 
Back
Top