Force lower case

Fat Boy

New member
Local time
Today, 23:26
Joined
Nov 29, 2012
Messages
3
Hi Guys - I'm new here so please be gentle.

I've been going round in circles trying to get this one sorted.

Scenario.

I have a table that holds user data. I have two fields - [User_Forename] and [User_Surname].

In a form I have concatenated the two files by using the Control Source of an unbound text box [User_Logon] set to =IIf(IsNull([User_Forename]),[User_Surname],[User_Forename] & [User_Surname])

This works fine, my problem is forcing [User_Logon] into lowercase. I have tried running:

Code:
Private Sub Form_Load()
  [User_Logon] = StrConv([User_Logon], 2)
End Sub

But this errors.

I have also tried

Code:
Private Sub User_Logon_AfterUpdate()
   [User_Logon] = StrConv([User_Logon], vbLowerCase)
End Sub

But that doesn't work either.

Help!!!
 
Last edited:
I am confused as to what you are trying to do.
you have a table with two name columns; First and Last name.
you want to create a form that connects the first and last names? I dont know where your input is though... i.e. what name actually appears when you load the form.

however in your second code you have
Private Sub YourFieldName_AfterUpdate()
is this the name of your field? did you name the field "YourFieldName"
also
[User_Logon] = StrConv([User_Logon], 2)
is the correct syntax as far as I can tell...

this would be easier to do in a query if you just want to list them all?
 
I am confused as to what you are trying to do.
you have a table with two name columns; First and Last name.
you want to create a form that connects the first and last names? I dont know where your input is though... i.e. what name actually appears when you load the form.

however in your second code you have
Private Sub YourFieldName_AfterUpdate()
is this the name of your field? did you name the field "YourFieldName"
also
[User_Logon] = StrConv([User_Logon], 2)
is the correct syntax as far as I can tell...

this would be easier to do in a query if you just want to list them all?

Sorry for not being clear.

I have a table that contains two fields - [User_Forename] & [User_Surname]

In a separate form I have an unbound text box [User_Logon] that concatenates these two fields.

e.g.
[User_Forename] = "Bob"
[User_Surname] = "Smith"

[User_Logon] = "BobSmith"

I want to force [User_Logon] into lower case.
 
You can use the LCase() function.

=LCase(IIf(IsNull([User_Forename]),[User_Surname],[User_Forename] & [User_Surname]))

You could probably change this to ...

=LCase([User_Forename] & [User_Surname] & vbNullString)


UCase forces it to Upper Case.
 
Sounds like you want to use the LCase[/URL]() function.

=LCase(IIf(IsNull([User_Forename]),[User_Surname],[User_Forename] & [User_Surname]))

UCase forces it to Upper Case.

You, my friend, are a star.

Thanks you very much, I've been pulling my hair out with this one.
 
why does this contain 2 i's

=LCase(IIf(IsNull([User_Forename]),[User_Surname],[User_Forename] & [User_Surname]))

aaaaaaa^
 

Users who are viewing this thread

Back
Top Bottom