Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / August 2007

Tip: Looking for answers? Try searching our database.

Uppercase only fix and prevent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
One complete fool - 02 Aug 2007 21:24 GMT
I have an Access 2003 database.

There is one field which must always be all uppercase.

I have just discovered that about 3500 records have been entered in
mixed case.

Is there a way to automatically change the case without the need to
retype manually?

And is there a way to prevent this from happening so that no matter
what is typed only uppercase will be entered into the field?

Thank you
Bob Quintal - 02 Aug 2007 21:08 GMT
> I have an Access 2003 database.
>
[quoted text clipped - 11 lines]
>
> Thank you

Sure. Write a query that does an update of fieldname to UCASE
(fieldname)

In the AfterUpdate event of the control for this field, on the
form used for data entry, just put me.txtboxname = ucase
(me.txtboxname) - change txtboxname to the real name for that
control.

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Klatuu - 02 Aug 2007 23:30 GMT
You mean Before Update event, don't you.  After is too late.
Signature

Dave Hargis, Microsoft Access MVP

> > I have an Access 2003 database.
> >
[quoted text clipped - 19 lines]
> (me.txtboxname) - change txtboxname to the real name for that
> control.
Graham Mandeno - 03 Aug 2007 00:11 GMT
Hi Bob

Actually, strange as it may seem, it IS the AfterUpdate event you should
use.

You cannot change the data in a control during its BeforeUpdate event
because you get the following message:
The macro or function set to the BeforeUpdate or ValidationRule property for
this field is preventing Microsoft Access from saving the data in the field.

Signature

Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

> You mean Before Update event, don't you.  After is too late.
>
[quoted text clipped - 21 lines]
>> (me.txtboxname) - change txtboxname to the real name for that
>> control.
Bob Quintal - 03 Aug 2007 11:48 GMT
> Hi Bob
>
[quoted text clipped - 6 lines]
> ValidationRule property for this field is preventing Microsoft
> Access from saving the data in the field.

I know that. You can use the beforeUpdate, with the control.text
property, which is only available while the control has focus. I've
found this to be a much more complex situation, with possibilities
for error.

And it is possible to use the BeforeUpdate of the Form, but again
you need to ensure that the focus is not on the control you are
trying to uppercase, which can happen
Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Bob Quintal - 03 Aug 2007 11:44 GMT
> You mean Before Update event, don't you.  After is too late.

No I meant AfterUpdate of the Control, not BeforeUpdate of the
Form.

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Douglas J. Steele - 02 Aug 2007 22:00 GMT
You could always use an Update query:

UPDATE MyTable
SET MyField = UCase([MyField])

To ensure that it's always in upper case, use the UCase function in the
form's BeforeUpdate event. If you're not using a form, there's nothing you
can do.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> I have an Access 2003 database.
>
[quoted text clipped - 10 lines]
>
> Thank you
missinglinq - 03 Aug 2007 04:31 GMT
Graham is right, you have to use the textbox's AfterUpdate event, not the
BeforeUpdate, for the reason he stated. You can, as Doug stated, use the
BeforeUpdate event of the  Form! Ain't Access grand?

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.