Results 1 to 4 of 4

Thread: Caps Lock

  1. #1
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81

    Unanswered: Caps Lock

    How do you turn on Caps Lock when someone loads a form?

    I used the Send Keys {CAPSLOCK} but it didnt work.

  2. #2
    Join Date
    Mar 2002
    Location
    Bielefeld, Germany
    Posts
    69
    Hi,

    not sure what you are trying to achieve, so a wild guess

    Think about using UCase on any user input. SendKeys is generally to be considered harmful, in my experience.

  3. #3
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81
    I have a form that we enter label info into
    PO Number
    Item Number (product)
    Client ID
    Qty
    Unit Type

    The PO and Item Number field is a combination o letters and numbers.

    Example:
    PO might be IBF765866
    Item would be F01-0987-0987

    I can go into the FORMAT of the field and type ">" which means uppercase HOWEVER I have an INPUT MASK in teh Item Number field that is A00-0000-0000. When I put the ">" in there, it takes all of the "-" out of the field. I MUST have these dashes in there. Sometimes, the operator may forget to turn CAPS on so the alpha characters are all lowercase when we need them to be uppercase.

    How do I use UPcase? I dont like SendKeys either.

  4. #4
    Join Date
    Mar 2002
    Location
    Bielefeld, Germany
    Posts
    69
    Try this:

    yourform.KeyPreview = true

    Private Sub youform_KeyPress(KeyAscii As Integer)
    Dim strCharacter As String

    ' Convert ANSI value to character string.
    strCharacter = Chr(KeyAscii)
    ' Convert character to upper case, then to ANSI value.
    KeyAscii = Asc(UCase(strCharacter))
    End Sub

    You can also use yourTextfield_KeyPress if you only need this for certain fields.

Posting Permissions

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