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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Convert to Ucase keystroke-by-keystroke (Access 2000)

    Author
    Topic
    #358704

    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

    Viewing 1 reply thread
    Author
    Replies
    • #535798

      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

      • #535809

        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.

        • #535819

          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.

          • #535829

            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!

            • #535841

              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.

        • #535832

          >>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.

          • #535837

            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!

    • #535820

      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?

    Viewing 1 reply thread
    Reply To: Convert to Ucase keystroke-by-keystroke (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: