For the same example, the Change event procedure is: Call LimitChange() in your text box's Change event.For example, to limit a control named "City" to 40 characters, its KeyPress event procedure is:Ĭall LimitKeyPress(Me.City, 40, KeyAscii) Call LimitKeyPress() in your text box's KeyPress event.Paste the two "subs" from the end of this article into a module.However, the input mask has side effects such as appending underscores to the Text property and making it difficult to insert text into the middle of an entry.įor a cleaner result, use a combination of the control's KeyPress and Change events. Unbound controls can be limited with the Input Mask - one "C" for each possible character. Microsoft Access tips: Unbound text box: limiting entry length Microsoft Access Tips for Serious UsersĪccess automatically prevents you entering too much text if a control is bound to a field.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |