How do I make entry all caps
Posted: Thu Feb 23, 2012 3:48 am
Is it possible to make the data entered into my forms be all capital?
User community support forum for Apache OpenOffice, LibreOffice and all the OpenOffice.org derivatives
https://forum.openoffice.org/en/forum/
mktork wrote:Is it possible to make the data entered into my forms be all capital?
Edit: See Villeroy's post below...
|
Code: Select all
Sub UPPER_case (oEvent As Object) 'Text Box > Events > When Losing Focus
oTextBox = oEvent.Source.Model
sText = Ucase(oTextBox.Text)
oTextBox.setString(sText) 'same effect as .BoundField.updateString() below
' oTextBox.BoundField.updateString(sText) 'same effect as .setString() above
' oForm = oTextBox.Parent 'these 3 lines combined will immediately save the record...
' oForm(oTextBox.Name).commit()
' IF oForm.isnew THEN oForm.insertRow() ELSE oForm.updateRow()
End Sub
F1 Help wrote:Edit mask
By specifying the character code in pattern fields, you can determine what the user can enter in the pattern field.
The length of the edit mask determines the number of the possible input positions. If the user enters characters that do not correspond to the edit mask, the input is rejected when the user leaves the field. You can enter the following characters to define the edit mask:
Character
Meaning
L
A text constant. This position cannot be edited. The character is displayed at the corresponding position of the Literal Mask.
a
The characters a-z and A-Z can be entered. Capital characters are not converted to lowercase characters.
A
The characters A-Z can be entered. If a lowercase letter is entered, it is automatically converted to a capital letter
c
The characters a-z, A-Z, and 0-9 can be entered. Capital characters are not converted to lowercase characters.
C
The characters A-Z and 0-9 can be entered. If a lowercase letter is entered, it is automatically converted to a capital letter
N
Only the characters 0-9 can be entered.
x
All printable characters can be entered.
X
All printable characters can be entered. If a lowercase letter is used, it is automatically converted to a capital letter.
For the literal mask "__.__.2000", for example, define the "NNLNNLLLLL" edit mask so that the user can only enter four digits when entering a date.
I did not know that. Thanks Villeroy!Villeroy wrote:Simply use a pattern field.
F1 Help wrote:Edit mask
A
The characters A-Z can be entered. If a lowercase letter is entered, it is automatically converted to a capital letter
C
The characters A-Z and 0-9 can be entered. If a lowercase letter is entered, it is automatically converted to a capital letter