Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uppercase (AccessXP 4.30)

    I'm feeling very ignorant and frustrated right now. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23> I cannot get Access to STORE data in fields in uppercase. It displays that way. But when I export to dBase for example (using a query) my data is in lowercase. EXCEPT where I use >!! in my "State" field. What am I missing for my other text fields? I do have ">" in both format and mask. Anyone have any thoughts?

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Uppercase (AccessXP 4.30)

    If you have an input mask with > for a field, the data in that field ought to be converted to upper case as you enter them, i.e. the value ought to be stored in upper case. Data existing before you set the input mask will not be modified, however.
    The Format property is for display only, it has no effect on the way the data are stored.

    You can take other measures:

    - To ensure that existing data are converted to upper case, create an update query based on your table. Add all fields you want to convert to the query grid, then change the query to an update query (use the Query menu.) In the Update To cell for each field, enter UCase([NameOfField]) with the appropriate field name substituted.

    - To ensure that new data are converted to upper case, you must use code in a form based on the table. Write an After Update event for each of the controls bound to a field you want to store in upper case:

    Private Sub NameOfField_AfterUpdate()
    Me.[NameOfField] = UCase(Me.[NameOfField])
    End Sub

    again, with the appropriate name substituted.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase (AccessXP 4.30)

    Thanks Hans!

    The code worked beautifully.

    And after a HUGE disaster by not writing the update query correctly, I did get it to work properly. Too bad the database backup was 8 days old instead of the 2 it should have <img src=/S/weep.gif border=0 alt=weep width=21 height=16>

    However, I was able to recover from that mess. And I'll remember now to test my queries like that on sample data first to make sure it does what I want to.

    Peggy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Uppercase (AccessXP 4.30)

    Umm, yes, it is always wise to test on a copy of the original database first. <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

  5. #5
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase (AccessXP 4.30)

    Yes, I am certainly embarrassed on that.

    But I was just wondering: what does the "me" stand for as in Me.[NameOfField]? Anything?

    Peggy

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Uppercase (AccessXP 4.30)

    In the code behind a form or report, "Me" stands for the form or report itself. Although the Me. is not strictly necessary, it has the advantage that the moment you type the period, IntelliSense kicks in and displays a list of available properties and methods, among which the controls. And by explicitly specifying that the control belongs to the form or report, the code becomes theoretically a little bit more efficient, because the VBA interpreter doesn't need to look up what it belongs to. But I doubt you would notice the difference.

  7. #7
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase (AccessXP 4.30)

    I understand what the "me" referred to. Just wondering why those particular letters and if they meant something. And it certainly does help when writing code to have the look available.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Uppercase (AccessXP 4.30)

    It's "me" as in "I, me, mine". These properties belong to Me.

  9. #9
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Pontiac, Michigan, USA
    Posts
    170
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase (AccessXP 4.30)

    Okay. That works for me (sorry!). One of life's little mysteries is now solved and I can sleep tonight <img src=/S/wink.gif border=0 alt=wink width=15 height=15> !

Posting Permissions

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