Full Version: Checking Text During Typing
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
NigelShaw150
Hi,

would it be possible to check text wording during typing? for example-

"The big fox ran after the little fox up across the field field"

i have 2 entries of fox and 2 entries of field. i need to try and make something that would highlight a form control (textbox) with the duplicated word as i typed for example-

HALT! Field is entered twice

can this be done?


cheers

Nigel
Peter Hibbs
Hi Nigel,

You could check the field's Text property after each keypress (use the On Change event).

Peter Hibbs.
NigelShaw150
hi Peter,

i'll give that a go and report back.

thanks

Nigel
NigelShaw150
Hi Peter,

not sure if that would actually work. it would need to store the current word being types in order to check if the word existed...

it will need some serious thought lol


Cheers

nigel
Peter Hibbs
Hi Nigel,

Why is that then?

The field's Text property holds what is being typed into the control (providing it has the focus) as opposed to the control's Value property which holds the typed text when the focus leaves the control.

For example, this code should work :-

Private Sub YourTextBoxControl_Change()

Dim Words As String

Words = Me.YourTextBoxControl.Text
'some code to process data in variable Words

End Sub


where YourTextBoxControl is the name of your Text box.

Peter Hibbs.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.