On_Change Fires to fast

klynch0803

Registered User.
Local time
Today, 16:08
Joined
Jan 25, 2008
Messages
102
I have a form that has a field on it that someone enters data in after its entered I want it to fire the vb along with it. I'm using hte on_Change but it fires on the first character they enter.

I dont want to use the after_Update even though it works because that means that the curser has to be moved before it fires. Unless someone knows a easy way to make it autofire in the after Update.

Basically someone is entering a number of digits Drivers License number in the field and it fires on first digit instead of when they are done. Which makes since on change is on change LOL...

What are some other options and the result of using them?
 
Check out the BeforeUpdate() event, which you can cancel if you don't like what you see for data in the control.
 
Check out the BeforeUpdate() event, which you can cancel if you don't like what you see for data in the control.

How do I get it to fire though it doesnt seem to fire at all LOL
 
Exactly what are you trying to accomplish?

How many characters long is the driver's license?

If the DL is always the same length, maybe this is what you need:

Where X is the number of characters in YourTextBox

Private Sub DLTextBox_Change()
If Len(Me.DLTextBox.Text) = X Then
‘Do your code here
End If
End Sub
 
Exactly what are you trying to accomplish?

How many characters long is the driver's license?

If the DL is always the same length, maybe this is what you need:

Where X is the number of characters in YourTextBox

Private Sub DLTextBox_Change()
If Len(Me.DLTextBox.Text) = X Then
‘Do your code here
End If
End Sub


It varies between 7 and 15 characters...

I'm trying to be able to swipe the card in a reader or type it in before it executes. I thought about a timer but then that would slow down the process..

Is there an on Enter meaning when the enter key is pressed? Therefore I could set the reader or barcode reader to press Enter after it scans..
 
The OnEnter event fires when you tab into the textbox, not when <Enter> is pressed. With the DL having a variable number of characters, I don 't really know what to suggest except to repeat Lagbolt's suggestion of using the textbox's BeforeUpdate event, which fires when you tab out or use <Enter> to move to another control. I'm not even positive that that will work with a card reader being used. BeforeUpdate fires if data is manually entered into the textbox, and a scanner/reader is an input device, like a keyboard, so maybe it will. You'd have to check.

You still haven't said what this code is supposed to do! Knowing might help us to help you.

Linq
 

Users who are viewing this thread

Back
Top Bottom