Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2005, 12:56 PM
Authorized User
 
Join Date: Dec 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: need to convert data entered to all caps

Hi,
   If I want to convert all the data entered in lower case to all caps. how I can I make it work? Thanks in advance!


flyfish
__________________
flyfish
 
Old March 16th, 2005, 02:05 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi ya flyfish!
Here's how.
In the on exit event for the data field, put in this code:

    Me.Field_Name = UCase(Me.Field_Name)

By putting it in the on exit event, it waits to convert until the user has left the field.

Hope it works for you!

Kevin


dartcoach
 
Old March 16th, 2005, 03:32 PM
Authorized User
 
Join Date: Dec 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi dartcoach,
  Thank you for your quick reply.
  I tested it work. I am wondering if I have 10 fields in a form that need to be converted into caps, do I had to go over one by one or I can use a loop to reach this goal?


flyfish
 
Old March 16th, 2005, 03:41 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Flyfish,
Depends. Some folks like to verify and edit fields entered on a form after they have all been entered. I prefer to edit them as they are entered. That way, each field has a valid value before they get to the next one. Personally, I would put the on exit event on each field.
If you want to though, on the last field on the form, you could update all 10 with:
me.field1 = ucase(me.field1)
me.field2 = ucase(me.field2)
etc.
The problem here is that they have to enter all fields and if they don't utilize the last field, the update is not made.

Hope this helps. Let me know.

Kevin

dartcoach
 
Old March 17th, 2005, 11:44 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

Actually you should use the AfterUpdate event. Then you'll get fields where data was entered/changed and don't have to worry about whether the user leaves the feild.

Ultimately most edits should be in BeforeUpdate if you want to prevent the data from being accepted. (BeforeUpdate has the Cancel parameter which you set to True if you don't want to accept the data.) Most data updates should go in the AfterUpdate. (Data updates would be like UCase or calulating another field on the form base on the data entered.)

IMHO, TWIT. (In My Humble Opinion. That's What I Think.)

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
 
Old March 18th, 2005, 12:35 PM
Authorized User
 
Join Date: Dec 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks lot for the discussion.

flyfish





Similar Threads
Thread Thread Starter Forum Replies Last Post
Show fields depending on data entered in previous Vaz ASP.NET 2.0 Basics 0 June 27th, 2006 09:16 AM
retaining the last data that was entered Calibus Classic ASP Databases 4 October 14th, 2004 03:31 PM
How to check entered data with Validator Control minhpx General .NET 2 September 15th, 2004 04:01 AM
How to check data entered 3 textboxs minhpx General .NET 1 September 13th, 2004 11:46 PM
Maintain entered data sporkman43 Classic ASP Basics 2 October 14th, 2003 02:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.