UCase function and default entry...

  • Thread starter Thread starter Ling
  • Start date Start date
L

Ling

Hi,

I've just learned of the use of the UCase function in an update quer
to change data to all uppercase. This is nice, but how can I force al
Entry to a form to uppercase?

I've tried a "calculated" field in the select qry for the form, FNU
UCase([fieldname]), and got a syntax error.
Also tried it in the default value prop for the field in the for
design. I think I just have syntax issues, because I know there is a
easy way to do this.

TIA
Ling66


-
Lin
 
I've just learned of the use of the UCase function in an update query
to change data to all uppercase. This is nice, but how can I force all
Entry to a form to uppercase?

I've tried a "calculated" field in the select qry for the form, FNU:
UCase([fieldname]), and got a syntax error.
Also tried it in the default value prop for the field in the form
design. I think I just have syntax issues, because I know there is an
easy way to do this.

Insert the following line of code into the control's "KeyPress" event procedure:

KeyAscii = Asc(UCase(Chr(KeyAscii)))

This will force upper case as the characters are entered.
 
Hi,

I've just learned of the use of the UCase function in an update query
to change data to all uppercase. This is nice, but how can I force all
Entry to a form to uppercase?

I've tried a "calculated" field in the select qry for the form, FNU:
UCase([fieldname]), and got a syntax error.
Also tried it in the default value prop for the field in the form
design. I think I just have syntax issues, because I know there is an
easy way to do this.

TIA
Ling663

Re:This is nice, but how can I force all Entry to a form to uppercase?

If you mean have the form accept the user entry only in upper case,
don't.
Let the user enter the data any which way they want.
Code the Control's AfterUpdate event:

[ControlName]=UCase([ControlName])

No matter how the text is entered by the user, when the field is
exited, the text will be converted to upper case.
 
ok answering my own posts, but if it helps someone I guess that's
ok....

But I am still having a slight problem with using an event proc for the
AfterUpdate prop of the form:
The UCase func is working as far as the field values go, but I get an
error message that the record can't be saved 'at this time'. Once
entry to the form is complete, tabbing or entering past the last field
just doesn't work (normally it would just open a new blank rec for
entry). I'm assuming it has everything to do with my little afterup
proc. Quite obviously I am a total beginner with the vba part of
Access.

again TIA,
Ling663

If you expect to get worthwhile help, I would strongly suggest you
include in any reply, the relevant portion of any previous post you
are referring to. Look at the portion of your post shown up above. It
allows any reader to accurately follow this reply, but they still
won't know of your original request as it isn't shown here.

I have to guess that you are referring to my previous suggestion of
using the Control's AfterUpdate event to convert a field to Upper
Case.

From my previous post:
Let the user enter the data any which way they want.
Code the Control's AfterUpdate event

It appears you used the Form's AfterUpdate event not the Control's
AfterUpdate event.
Change the event to the control's AfterUpdate and you should be OK, at
least as far as this Ucase problem.
If you have additional issues with your form, it won't be caused by
this.
 
ok answering my own posts, but if it helps someone I guess that'
ok....

But I am still having a slight problem with using an event proc for th
AfterUpdate prop of the form:
The UCase func is working as far as the field values go, but I get a
error message that the record can't be saved 'at this time'. Onc
entry to the form is complete, tabbing or entering past the last fiel
just doesn't work (normally it would just open a new blank rec fo
entry). I'm assuming it has everything to do with my little afteru
proc. Quite obviously I am a total beginner with the vba part o
Access.

again TIA,
Ling66


-
Lin
 
Back
Top