Before or After Update?

S

Steve

I have a field the will require an input in the following format:
"OR#####" where there is always the characters, "OR" and some number of
digits afterward. What I'm trying to do is to edit the field as the
user is leaving it so if they just typed the number the "OR" whould get
pre-pended to it. Is this something that should be done in the
BeforeUpdate section, ie,
If IsNumeric([MyField]) then [MyField] = "OR" & [MyField]

?

I haven't been able to get that to work...

TIA

Steve
 
R

Rick Brandt

Steve said:
I have a field the will require an input in the following format:
"OR#####" where there is always the characters, "OR" and some number
of digits afterward. What I'm trying to do is to edit the field as
the user is leaving it so if they just typed the number the "OR"
whould get pre-pended to it. Is this something that should be done
in the BeforeUpdate section, ie,
If IsNumeric([MyField]) then [MyField] = "OR" & [MyField]

?

I haven't been able to get that to work...

TIA

Steve

I believe in the BeforeUpdate event you can only programmtically alter the Text
property, not the Value property. In AfterUpdate you can update the Value
property.
 
S

Steve

OK, I'll try .text

Thanks

Rick said:
Steve said:
I have a field the will require an input in the following format:
"OR#####" where there is always the characters, "OR" and some number
of digits afterward. What I'm trying to do is to edit the field as
the user is leaving it so if they just typed the number the "OR"
whould get pre-pended to it. Is this something that should be done
in the BeforeUpdate section, ie,
If IsNumeric([MyField]) then [MyField] = "OR" & [MyField]

?

I haven't been able to get that to work...

TIA

Steve


I believe in the BeforeUpdate event you can only programmtically alter the Text
property, not the Value property. In AfterUpdate you can update the Value
property.
 
S

Steve

Updating the .Value property in AfterUpdate made it work!!!

Thanks

Steve

Rick said:
Steve said:
I have a field the will require an input in the following format:
"OR#####" where there is always the characters, "OR" and some number
of digits afterward. What I'm trying to do is to edit the field as
the user is leaving it so if they just typed the number the "OR"
whould get pre-pended to it. Is this something that should be done
in the BeforeUpdate section, ie,
If IsNumeric([MyField]) then [MyField] = "OR" & [MyField]

?

I haven't been able to get that to work...

TIA

Steve


I believe in the BeforeUpdate event you can only programmtically alter the Text
property, not the Value property. In AfterUpdate you can update the Value
property.
 
Top