entering information to an access database in uppercase only

E

EDMURP

I am new to creating databases and am able to create a basic database using
wizards etc. I am trying to create a database where all the information
entered by the user will be entered in upper case only no matter if they type
in upper or lower case. Can someone help with this question??
 
A

Al Camp

EDMURP,
In text controls, a Format of > will "display" all entries in upper case even
though they are stored in Upper and Lower.

Or... use the AfterUpdate event of each text control to trigger the following code...
Me.[YourFieldName] = UCase([YourFieldName])
That will store each text value in UpperCase in the table.
 
E

EDMURP

Thank you for a very swift reply, i appreciate your help. Can you tell me
where I would get a step by step guide to doing this. I somewhat understand
what you are saying but unsure where to start and some of the terms. I am
very new to this and sefl taught.

Thanks and Regards


Al Camp said:
EDMURP,
In text controls, a Format of > will "display" all entries in upper case even
though they are stored in Upper and Lower.

Or... use the AfterUpdate event of each text control to trigger the following code...
Me.[YourFieldName] = UCase([YourFieldName])
That will store each text value in UpperCase in the table.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

EDMURP said:
I am new to creating databases and am able to create a basic database using
wizards etc. I am trying to create a database where all the information
entered by the user will be entered in upper case only no matter if they type
in upper or lower case. Can someone help with this question??
 
R

Rick Brandt

EDMURP said:
Thank you for a very swift reply, i appreciate your help. Can you tell me
where I would get a step by step guide to doing this. I somewhat understand
what you are saying but unsure where to start and some of the terms. I am
very new to this and sefl taught.

Thanks and Regards

In your form's design view select one of the TextBoxes for entering data and
then find the AfterUpdate event property box on the {Events} tab of the property
sheet. In that box enter "[Event Procedure]" from the drop-down list of choices
and then press the build [...] button to the right of the property box.

That will take you to the VBA code window within the module attached to the form
and your cursor will be pre-positioned between the two lines that define the
AfterUpdate event for your TextBox. Between those two lines enter...

Me!TextBoxName = UCase(Me!TextBoxName)

....substituting the actual name of your control. Save and exit the VBA code
window. You should now find that when you enter text in that TextBox that it
will be changed to all caps when you tab out of it. Repeat this for all other
TextBoxes on your form.
 
E

EDMURP

Hey there, many thanks for your help, I am now nearly there.
I followed your instructions in the first paragraph with ease. when the VBA
code window appears I am unsure what I should type. I am not sure what
Me!TextBoxName = UCase(Me!TextBoxName)

Means.....
Can you please explain more? The text box name is CSR in this case so should
I type
Me!CSR=UCase(Me!CSR)

Thansk for your reply in advance.
 
R

Rick Brandt

EDMURP said:
Hey there, many thanks for your help, I am now nearly there.
I followed your instructions in the first paragraph with ease. when the VBA
code window appears I am unsure what I should type. I am not sure what

Means.....
Can you please explain more? The text box name is CSR in this case so should
I type
Me!CSR=UCase(Me!CSR)

Thansk for your reply in advance.

Exactly that.
 
K

Ken Sheridan

In a control on a form you can force all text entered to upper case as its
typed. First add this procedure to a standard module:

Public Sub ConvertToCaps(KeyAscii As Integer)
' Converts text typed into control to upper case

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))

Exit Sub

End Sub

Then in each control's KeyPress event procedure call the procedure:

' Call ConvertToCaps procedure to convert input to upper case
ConvertToCaps KeyAscii

Ken Sheridan
Stafford, England
 
Top