create text box showing how many characters remain during input to form's text box (1 Viewer)

EdK

Registered User.
Local time
Yesterday, 17:36
Joined
May 22, 2013
Messages
37
Hi all,

I have a form with various text fields to which I do input. I know the character limit is 254 and that's fine. But I would like during input to know how many characters are left that I can use for input to that field/record. Why? Because that would enable me to (as necessary) rephrase (ie shorten) what I'm presently inputting. Does that make sense? I envisage a separate text box, one for each of the various text input fields, that would display the number of remaining characters per field. So, for each of my 8 input text fields on that form, I guess there would have to be one "text characters remaining" type field ie 8 of those "characters left" display boxes ? And that would be fine, for me.

However, what would be ideal would be for there to be a facility whereby as soon as the cursor is put into the/an input field, a display box showing how many characters were left would pop up and would progressively do a "count down" of remaining characters (as I type the input), and this display box would remain open until the cursor_focus was moved elsewhere.

I don't want to change any of these text fields into memo fields (even though that would fix the basic problem). Why? Because if they were memo type instead of text type, then I would tend to "bloat" the data base content ie I would tend to not be concise with the wording; also, some of these text fields require/provide sorting into alpha order.

I would really appreciate help on this little issue and/but if it is code-based I would probably need some step by step instructions during the process. Actually, this forum &/or MS Access 2007 (which is what I'm using) quite possibly has some standard routine for this already?

Hoping for some enlightenment!!

EdK 5 November 2021
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:36
Joined
Oct 29, 2018
Messages
17,574
Hi. In the Change event of a Textbox, you can use something like:

Len([TextboxName].Text)
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:36
Joined
May 7, 2009
Messages
15,030
it does not only show the "remaining" characters left for input.
it also prevent further input when the remaining chars has reached 0.
 

Attachments

  • limit_textbox.accdb
    504 KB · Views: 42

EdK

Registered User.
Local time
Yesterday, 17:36
Joined
May 22, 2013
Messages
37
Hi. In the Change event of a Textbox, you can use something like:

Len([TextboxName].Text)
Hi DBguy - sounds good. I think that's what I could use with the routine that Arnelgp has suggested in his post (which is sublime in its simplicity, and which is btw the essence of genius ....) EdK
 

EdK

Registered User.
Local time
Yesterday, 17:36
Joined
May 22, 2013
Messages
37
it does not only show the "remaining" characters left for input.
it also prevent further input when the remaining chars has reached 0.
Thanks a million Arnelgp, you are a genius. I just love your routine, which I've "upped" from 100 to 255 characters, as is text field size limit. I will try and incorporate it into each of my input fields on that form, via "on change event ..... call .... your routine" (I think that is what you meant). Wish me luck as I know no code work at all. I will have fun just experimenting. EdK
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:36
Joined
May 7, 2009
Messages
15,030
Wish me luck as I know no code work at all. I will have fun just experimenting. EdK
then i wish you Goodluck!
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:36
Joined
Oct 29, 2018
Messages
17,574
Hi DBguy - sounds good. I think that's what I could use with the routine that Arnelgp has suggested in his post (which is sublime in its simplicity, and which is btw the essence of genius ....) EdK
Hi. Glad to hear you have a solution now. Cheers!
 

Users who are viewing this thread

Top Bottom