Inspecting values on a form as they change...

H

hzgt9b

I have a form bound to a table...
As changes are made to a field on the form, I want to inspect the change and
perform some action...
The problem that I am running into is that when I inspect the value using
the "On CHange" event, the data that is returned to me is not what was typed
into the form... it is missing the change (the character) that was just typed.

Specifics:
Here's what I've got.. a table named Config. Attributes: ID, Key, Value,
Description.
My form allows the user to make changes to the Value attribute... but When I
inspect the me.Value property, the value returned doesn't contain the last
character typed into the Value field...

Any help would be appreciated...
 
O

Ofer

Why aren't you using the before update event of the field, to check the full
value entered in the field.
With the possibility to cancel the entry by running the code
cancel = true
 
L

lwells

Have a look at the .Text property rather than the .Value in On Change Event.

The .Value is after the record has been updated. The .Text will display
what was currently typed into the control before it is updated.

lwells
 
H

hzgt9b

From what I gather from my testing, Before update is only triggered as the
entire record looses focus... I can't wait until the user selects another
record before inspecting changes...
 
H

hzgt9b

That worked for me... but it brings up another question for me...

WHen I inspect the value for the "Key" field, I say: Me.key, but Me.Key.Text
is not defined.... why does this attribute not have a text propoerty and but
the "Value" attribute have a text property. i.e. Me.Value.Text returns the
correct string...
 
L

lwells

Is the name of your control on your form actually "Key"? Make sure you are
using the actual name of the control.
 
H

hzgt9b

Yep - the name of the control is the same name as the attribute on the
underlying table... attribute name=Key, control name=Key - same with Value
attribute, etc.
 
Top