Hello,
What I am looking for is a way to limit a user to having more than 127
characters in a Text Box. I know the simple way is to have an Input Mask.
But I dont want to use the Input Mask Property, I can explain why if needed.
So one way I know you can is in the KeyDown Event...
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Len(txtNotes.Text) > 126 And Then KeyCode = 0
End Sub
This works if the user tries to TYPE more than 127 characters. But it does
not help if the Users COPIES and PASTEs text into the Field. So for example
if there are 100 characters in there & they Copy some large text from
somewhere else & then Right click & Paste into this one it will take it. How
can I prevent this from happening ? But want to allow to Paste if total is
less than 127 characters.
I know I can also use the BeforeUpdate & AfterUpdate Events to trim down the
large amount of Text after the fact, but what I prefer is to just not allow
it from the begining.
So some way to prevent users from Pasting more than 127 Characters.
Any help would be greatly appreciated.
Thank You,
Jeff
Ken Snell [MVP] - 17 Nov 2005 17:20 GMT
Only way I know is to use the BeforeUpdate or AfterUpdate events....

Signature
Ken Snell
<MS ACCESS MVP>
> Hello,
>
[quoted text clipped - 32 lines]
> Thank You,
> Jeff
Jeff - 17 Nov 2005 17:37 GMT
Ken thank you, but as I mentioned the BeforeUpdate & AfterUdate Events are
not triggered until the user moves the focus away from the control.
I want to prevent before this happens... any way ?
Thank you,
Jeff
> Only way I know is to use the BeforeUpdate or AfterUpdate events....
> > Hello,
[quoted text clipped - 33 lines]
> > Thank You,
> > Jeff
Jeff - 17 Nov 2005 17:43 GMT
Sorry I figured it out, can use the CHANGE EVENT as that is triggered & then
I just used =Left(...,127)
Thank you
> Hello,
>
[quoted text clipped - 25 lines]
> Thank You,
> Jeff
Rick Brandt - 18 Nov 2005 12:42 GMT
> Hello,
>
> What I am looking for is a way to limit a user to having more than 127
> characters in a Text Box. I know the simple way is to have an Input Mask.
> But I dont want to use the Input Mask Property, I can explain why if needed.
Any reason you don't just use a Text DataType in the table with the length set
to 127?

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com