Results 1 to 6 of 6
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: set function to check and convert the textboxes in a form

    I am trying to convert the text entered in six textboxes to uppercases and store each back in their textboxes.

    Ex:
    Private Sub txtpartNum_AfterUpdate()

    If Not IsNull(txtpartNum) Then
    txtpartNum = UCase$(txtpartNum)

    End If


    Is there a form property I can set this function to check and convert the textboxes instead of going to each textbox and placing this function in its property?

  2. #2
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    There are a few form properties that could be used.
    When you close a form, the following events occur in this order:
    Unload, then Deactivate, then Close.

    The event you chose would call the function, which of course, would have to have code to update all six of the textboxes. It would probably be worth while to have two functions. A function [e.g. MakeUpper()] to switch to uppercase and the main function which checked for null and then sent the string to MakeUpper().

    A better choice is just to have an input mask on the form controls that forces upper case. Try >aaaaaaaaaaaaaaaaaaaaa (number of a's for number of alpha chars you want).
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  3. #3
    Join Date
    May 2002
    Posts
    395

    uppercases

    Thanks for your help..
    I love the idea in utilizing the input mask in the controls to do the case conversion.

    Thanks again!

  4. #4
    Join Date
    May 2002
    Posts
    395

    input mask

    I have a problem and I can’t figure it out.

    The input mask property works great if the value I typed in the combo doesn’t match with the first character of the table in that field, it’ll convert each letter as I type it in. But if the first letter I typed in matches the field in the table, it’ll automatically populate the combo box with the value from the table(upper cases) and place the cursor @ the end of the text. I have to delete the value before I can enter. How can I keep the value from populating automatically in the combo box?

    Thanks!

  5. #5
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    On the combobox controls, there is a propety call "auto expand." Turn that thing off and see if the problem persists.
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  6. #6
    Join Date
    May 2002
    Posts
    395

    using functions instead

    No, it doesn't work.
    But using functions to convert cases seem to be working.
    Neverthless, Thank you.

Posting Permissions

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