Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Always LowerCase

Status
Not open for further replies.

FredSB

Programmer
Nov 20, 2002
11
US
How would I cause a field in my Access form to always be entered and displayed as lowercase. I've tried putting a '<' in the format property but if I use the CAPS key, the results are Uppercase. Can you also help me in wrting a query as I need to convert this same field in my table to lower case. Thanks
 
ucase( ) is the VB converter. I am not sure if there is an lcase() I would guess less. In which case you would have to redo all fields with an lcase() If you want code for this, ask again in this post a on_event and a for loop would do it nicely.

Rollie E
 
For future records put this code in OnExit event of field you want to be lower case.

Dim varFL As Variant

varFL = Me.FindLocation 'your field name here

If Not IsNull(varFL) Then
varFL = StrConv(varFL, vbLowerCase)
Me.FindLocation = varFL
End If
 
You could use this simplified version:


Private Sub FieldName_AfterUpdate()
Me.FieldName.Value = StrConv([FieldName], vbLowerCase)
End Sub

Other examples could use vbUpperCase or vbProperCase


Garry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top