Microsoft KB Archive/100469: Difference between revisions
(importing KB archive) |
m (Text replacement - "<" to "<") |
||
(2 intermediate revisions by the same user not shown) | |||
Line 64: | Line 64: | ||
In Microsoft Access version 2.0 and later, you have two additional alternatives: an input mask, or an event procedure triggered by the KeyPress event. The following input mask will accept either letters or numbers and will make the first letter uppercase and the following three lower case:<br /> | In Microsoft Access version 2.0 and later, you have two additional alternatives: an input mask, or an event procedure triggered by the KeyPress event. The following input mask will accept either letters or numbers and will make the first letter uppercase and the following three lower case:<br /> | ||
<pre class="fixed_text"> | <pre class="fixed_text"> >C<CCC | ||
</pre> | </pre> | ||
<br /> | <br /> | ||
Line 84: | Line 84: | ||
== REFERENCES == | == REFERENCES == | ||
For more information about input masks, search the Help Index for | For more information about input masks, search the Help Index for "InputMask property," or ask the Microsoft Access 97 Office Assistant.<br /> | ||
<br /> | <br /> | ||
For more information about validation rules, search the Help Index for | For more information about validation rules, search the Help Index for "ValidationRule property," or ask the Microsoft Access 97 Office Assistant.<br /> | ||
<br /> | <br /> | ||
For more information about OnKeyPress, search the Help Index for | For more information about OnKeyPress, search the Help Index for "OnKeyPress property," or ask the Microsoft Access 97 Office Assistant. | ||
</div> | </div> |
Latest revision as of 10:16, 20 July 2020
Article ID: 100469
Article Last Modified on 1/18/2007
APPLIES TO
- Microsoft Access 1.0 Standard Edition
- Microsoft Access 1.1 Standard Edition
- Microsoft Access 2.0 Standard Edition
- Microsoft Access 95 Standard Edition
- Microsoft Access 97 Standard Edition
This article was previously published under Q100469
Novice: Requires knowledge of the user interface on single-user computers.
SUMMARY
Microsoft Access does not have a setting to force entries in a field or control to be in uppercase letters; however, you can use a validation rule to ensure that only uppercase letters are used.
The following sample validation rule requires that entries in a field or control called Last Name be entered in uppercase letters:
StrComp(UCase([Last Name]),[Last Name],0) = 0
In Microsoft Access version 2.0 and later, you have two additional alternatives: an input mask, or an event procedure triggered by the KeyPress event. The following input mask will accept either letters or numbers and will make the first letter uppercase and the following three lower case:
>C<CCC
Follow these steps to change letters to uppercase as you type them in a control in a form:
- Open the form in Design view.
Set the control's OnKeyPress property to the following event procedure:
Sub Field0_KeyPress (KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) End Sub
REFERENCES
For more information about input masks, search the Help Index for "InputMask property," or ask the Microsoft Access 97 Office Assistant.
For more information about validation rules, search the Help Index for "ValidationRule property," or ask the Microsoft Access 97 Office Assistant.
For more information about OnKeyPress, search the Help Index for "OnKeyPress property," or ask the Microsoft Access 97 Office Assistant.
Additional query words: capital letter upper case all
Keywords: kbinfo KB100469