confused !!!

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have an exression in a text control's AfterUpdate
event: Last=Ucase(Last) on a form, which capitalizes the
first letter for a last name.
I did some editing to the form (removed the text box from
the form and placed back in), now this expression stopped
working, regardless it has the same expression.
How I can fix it?
 
Tom,

If the expression is in the code then make sure the AfterUpdate property in
the events tab of the property sheet for the textbox reads '[Event
Procedure]' And make sure the textbox has the same name as the code
procedure.

HTH,
Josh
 
Tom said:
I have an exression in a text control's AfterUpdate
event: Last=Ucase(Last) on a form, which capitalizes the
first letter for a last name.
I did some editing to the form (removed the text box from
the form and placed back in), now this expression stopped
working, regardless it has the same expression.
How I can fix it?

Two things are required for event code to run.

(1)
The procedure code must exist in the module.

(2)
The event property must have the entry "[Event Procedure]" when viewed in
the property sheet.

(1) is doing the work while (2) is what triggers it to run.

When you remove a control from a form and then put it back you will have
lost (2) and will need to restore that entry. As you have discovered, the
code is still there. It just doesn't have anything telling it to run any
more.
 
Wow, that was it.
Thank you guys a lot
-----Original Message-----
Tom,

If the expression is in the code then make sure the AfterUpdate property in
the events tab of the property sheet for the textbox reads '[Event
Procedure]' And make sure the textbox has the same name as the code
procedure.

HTH,
Josh

I have an exression in a text control's AfterUpdate
event: Last=Ucase(Last) on a form, which capitalizes the
first letter for a last name.
I did some editing to the form (removed the text box from
the form and placed back in), now this expression stopped
working, regardless it has the same expression.
How I can fix it?


.
 
Tom said:
Wow, that was it.
Thank you guys a lot
-----Original Message-----
Tom,

If the expression is in the code then make sure the AfterUpdate property in
the events tab of the property sheet for the textbox reads '[Event
Procedure]' And make sure the textbox has the same name as the code
procedure.

HTH,
Josh

I have an exression in a text control's AfterUpdate
event: Last=Ucase(Last) on a form, which capitalizes the
first letter for a last name.
I did some editing to the form (removed the text box from
the form and placed back in), now this expression stopped
working, regardless it has the same expression.
How I can fix it?
Tom,

Regarding: >Last=Ucase(Last) on a form, which capitalizes the
first letter for a last name. <

I'm glad that fixed it for you, now please explain to me how it was
working before?
Seems to me that the UCase() function capitalizes ALL the letters in the
field, not just the first letter.
To capitalize just the first letter in a field you would use
=strConv([FieldName],3)

And you also did change the name of the field from [Last] to [LastName]
as suggested by another poster, I hope?

Check out the following KnowledgeBase articles:

109312 'Reserved Words in Microsoft Access'
209187 'Acc2000: 'Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
 
Back
Top