Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert to Ucase keystroke-by-keystroke (Access 2000)

    Anyone know how to convert input into a text box into upper case as the user types? e.g. If I type "abc", it is converted, as I type, to "ABC"
    Thanks,
    Gwenda

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    The easiest way is to use an input mask. The ">" character converts to upper case. The following mask would allow for 5 letters, capitalizing them as you went (see Help for other allowed characters in input mask):

    >LLLLL
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    The downfall of using > to convert to upper case is that it only converts how it looks. If you actually export the data or print it in labels or a report, it reverts to how it was actually typed.
    What would be needed is some kind of update in the keypress event using the UCase([field]) function (never actually used the keypress event though).
    Hope this helps.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    Input masks take an argument in the third segment of the mask that determines whether the data is saved as entered or according to the mask.
    Charlotte

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    Still another method is to use the Change event of the control to UCase the value of the control so far. However, Change happens with every keystroke, so it can be a very resource-intensive event. Why not just use the AfterUpdate event of the control to UCase the whole thing?
    Charlotte

  6. #6
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    I haven't used input masks much before, I just happened to know what I typed (without adding any bits) was true. I knew because we accidentally added about 3 weeks worth of work to our main database using just the > command before anyone noticed what was going on. It was a bit of a nightmare as we can't do mass editing to our database. Where is the 3rd segment of the input mask? Or is it in the mask wizard? Which strangely doesn't appear to be installed on my machine!

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    >>The downfall of using > to convert to upper case is that it only converts how it looks. <<

    Not in my experience. Granted, it will display as all caps even if the underlying data is lower case; but any entry you make will be made into permanent uppercase and stored in the table that way.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    My mistake, just had a look at my old notes..........I had the > in the format field, which automatically sets it all to uppercase but only to view...appologies! Shame on me, spreading false info like that - said I didn't use that sort of thing much didn't I!

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    Sorry, my mistake. It's the *second* argument that controls whether literal values are stored. Look up InputMask Property in on-line help (use the answer wizard, forget the index) and it will explain the ins and outs of the inputmask. Frankly, I don't know whether that argument will affect uppercase because I never use an input mask for that purpose.
    Charlotte

  10. #10
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert to Ucase keystroke-by-keystroke (Access 2000)

    Thanks for all of your help. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •