Results 1 to 7 of 7
  1. #1
    aommaster is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    3

    Converting all text input to lower case

    Hi everyone!



    This seems incredibly simple, yet, I can't get it to work.

    I'd like to have all user inputs into a form (or a table, for that matter) to be converted to lower case before saving.

    In essence, all data must be converted to lower case and whatever data is displayed in the table is lowercase.

    From the table, I've tried changing the format of the respective field to "<" but that doesn't seem to solve the problem. For some odd reason, the data still behaves as a string with uppercase characters (and this is displayed when the data is clicked... I can see the original string with the upper case characters) even though the string looks like the conversion had been made.

    I also tried to modify the form directly, by using the OnChange event = =LCase([Process Path].[Text]), where Process Path is the name of the field in question.

    However, this seems to do the same thing as setting the field format to ">".

    What am I doing wrong? How can I fix this?

    Thanks again

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can do it in the KeyDown event if you want.

  3. #3
    aommaster is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    3
    Hi RuralGuy!

    Thanks for your reply. Unfortunately, I don't have much experience with programming in Access, so could you please elaborate on that?

    Also, was the method I applied (both by using field formats and form events) wrong usage? If not, why didn't it work? It seemed like the original string value had upper cases in, while it displayed as lowercase. Is there a way of changing that?

    Thanks again for your time

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Using the Format instructions *only* changes how the field is displayed, not how it is stored. I rarely use the OnChange event. Is the name of the control [Process Path] as well as the field to which it is bound? I would change the control name to txtProcessPath so there is no confusion. I'll get you the KeyPress code but you will need to turn on the KeyPreview of the form for it to function correctly.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's the KeyPress event for the control you want held to LowerCase:
    Code:
    Private Sub YourControl_KeyPress(KeyAscii As Integer)
     
       Select Case KeyAscii
          Case 65 To 90
             KeyAscii = KeyAscii + 32
       End Select
     
    End Sub
    ...using YourControl name of course. Remember to set the KeyPreview for the FORM to YES.

  6. #6
    aommaster is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    3
    Hi RuralGuy!

    Thank you very much for your reply. I also see what you did with that. You just shifted the character code up the ascii table to have it switch to lower case. I do have a fair bit of programming experience (some of which is VB .Net), but I've never really done anything in Access.

    Thanks again for your great help RuralGuy! I really appreciate it

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad I could help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Converting Access 2000 or 2003 to 2007
    By AnnaK in forum Access
    Replies: 1
    Last Post: 06-09-2009, 08:40 AM
  2. Use Case Scenarios
    By scott.weppler in forum Access
    Replies: 0
    Last Post: 05-31-2009, 12:15 PM
  3. is access case-sensitive?
    By pen in forum Programming
    Replies: 1
    Last Post: 04-07-2009, 05:13 AM
  4. Converting Access Databases
    By awpic1964 in forum Import/Export Data
    Replies: 1
    Last Post: 08-04-2008, 06:54 AM
  5. Replies: 0
    Last Post: 11-04-2006, 02:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums