From: Maracay on
Hi Guys

I have and unbound text box, the lenght is 150, how can I create and input
mask this big to allow, letter, numbers and special characters, I don't want
the user to type more that 150 characters because I need to store the
information in a table field 150 lenght.

Thanks
From: Amy E. Baggott on
You should be able to do this by using the Validation Rule property of the
text box. Set it to

= Len([fieldname] <=150

where fieldname is the name of the field you're in. Then set the Validation
Text to tell them what to do about it.

--
Amy E. Baggott

"I''m going crazy and I''m taking all of you with me!" -- Linda Grayson


"Maracay" wrote:

> Hi Guys
>
> I have and unbound text box, the lenght is 150, how can I create and input
> mask this big to allow, letter, numbers and special characters, I don't want
> the user to type more that 150 characters because I need to store the
> information in a table field 150 lenght.
>
> Thanks
From: John W. Vinson on
On Fri, 23 Apr 2010 13:01:02 -0700, Maracay
<Maracay(a)discussions.microsoft.com> wrote:

>Hi Guys
>
>I have and unbound text box, the lenght is 150, how can I create and input
>mask this big to allow, letter, numbers and special characters, I don't want
>the user to type more that 150 characters because I need to store the
>information in a table field 150 lenght.
>
>Thanks

No input mask is needed or appropriate. If the length of the field is 150,
that's all the user will be able to store anyway.

You can use the textbox's Change event to alert the user that they're out of
room (or running out); e.g. you could have an unbound textbox txtLeft on the
form, and use code like

Private Sub MyBigTextbox_Change()
Me.txtLeft = 150 - Len(Me!MyBigTextbox.Text)
If Me.txtLeft <= 0 Then
MsgBox "You're being prolix and excessively verbose!", vbOKOnly
End If
End sub
--

John W. Vinson [MVP]
 | 
Pages: 1
Prev: Form
Next: How To Go From One Form to Another