Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2006

    Unanswered: Input Mask Creation Problems

    I am working on a database which has to have all letters entered in CAPS. To accomplish that I have been creating input masks so I can use the ">" portion and also control (in some cases) the data in other ways.

    I am having a problem. I have successfully created a number of masks with the normal learning curve. However, there are some field that could be rather lengthy - one is defined for up to the 255 max for text. I am willing to create a mask for that as well, but the system will not let me. It refuses to take any additional mask characters after about 35 to 40.

    I have thus far been unsuccessful finding anything that suggests there might be limits such as this.

    I suspect the more elegant way would be to write some code, but that is not my strength at all.

    Any suggestions?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2003
    One ">" converts the entire field to uppercase, not just the first character.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Jan 2007


    Check out the attached db. It uses a masking function that I got from somewhere else. The names are mentioned in the comments but I don't
    remember them. It is currently masking with an '*' but it mentions you
    can change that in one of the sub calls.

    Attached Files Attached Files

  4. #4
    Join Date
    Dec 2006
    Alternately, you could write an OnKeyUp subroutine that changes every character typed to upper case.

  5. #5
    Join Date
    Jan 2007
    If the user is only trying to make the entire string capital

    Private Sub Command1_Click()
    Dim X

    X = UCase(InputBoxDK("Type your password here.", "Password Required"))
    If X = "" Then End
    If X <> "yourpassword" Then
    MsgBox "You didn't enter a correct password."
    MsgBox Len(X)
    MsgBox X
    End If

    MsgBox "Welcome Creator!", vbExclamation

    End Sub

  6. #6
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    If your statement :

    I am working on a database which has to have all letters entered in CAPS
    is factual, i.e. ALL text needs to be entered in uppercase, the easiest thing to do is to put the CapsLock on when you start your database and then turn it off when you exit the database. It's not hard to do.

    From the Access Objects Dialog box goto Modules > Create new and paste this code:

    'Windows API/Global Declarations for :CapLock
    Public Const VK_CAPLOCK = &H14
    Public Type KeyboardBytes
    kbByte(0 To 255) As Byte
    End Type
    Public kbArray As KeyboardBytes
    Public Declare Function GetKeyState Lib "user32" _
    (ByVal nVirtKey As Long) As Long
    Public Declare Function GetKeyboardState Lib "user32" _
    (kbArray As KeyboardBytes) As Long
    Public Declare Function SetKeyboardState Lib "user32" _
    (kbArray As KeyboardBytes) As Long
    When prompted name the module something like ControlCapsLock

    In the On_Load sub of the first form in your db that is used place this code:

    'Turn Capslock On
    GetKeyboardState kbArray
    kbArray.kbByte(VK_CAPLOCK) = 1
    SetKeyboardState kbArray
    Then last thing before closing your db place this code:

    'Turn Capslock OFF
    GetKeyboardState kbArray
    kbArray.kbByte(VK_CAPLOCK) = 0
    SetKeyboardState kbArray
    Sorry to say, I picked this hack up so long ago I don't remember where I found it, and so can't give proper credit for it. I've been using it a number of years now without problems.
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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