how to run a code after my text box has 14 chars

M

Marco

Hello,

I need to run a code when the size of my field is 14.

Imagine this, I'm typing some chars in the field and then when I type the 14
char I want that the form run a code.

How can I control in code the max size of a field?

P.S: The code is find record.

Thanks,
Marco
 
K

Klatuu

This is one of the few valid uses of the textbox control's Change event. It
fires every time the value changes (ie - a keystroke), so in the Change
event:

If Len(Me.txtMyTextBox) = 14 Then
Do whatever you do when it hits 14
End If
 
M

Mike Painter

Marco said:
Hello,

I need to run a code when the size of my field is 14.

Imagine this, I'm typing some chars in the field and then when I type
the 14 char I want that the form run a code.

How can I control in code the max size of a field?

P.S: The code is find record.

Thanks,
Marco
Does it always require 14 letters to have enough information to find the
record?
If not a combobox might be a better choice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top