Is there a way to have Title Caps?

rosemere

New member
Local time
Today, 09:08
Joined
Dec 3, 2006
Messages
9
Hopefully this the correct place to post my question, as this is my first post here.
I have been entering data in a Microsoft Access . I don’t know if it is possible but I have been entering text that needs the First Letter of each word a Capital. The reason is it would make entering the data faster if I did it all in lower case and then it just converted to Title Caps.

I have searched everywhere and maybe it isn’t possible to have a code in Format for this. I am using the > for all upper case for another Field .

If there is a way to do this When I go to design View what do I enter in the lower box Beside Format. Here is an example of what I am trying to do:

portrush golf club and I want it to look like Portrush Golf Club after I finish typing.

Please don't use very complicated software language is this is possible as I don't understand a lot of the computer design jargon.:confused:
 
text

Use vbpropercase.

me.MyString = StrConv(me.MyString, vbProperCase)
 
Rickster57 said:
Use vbpropercase.

me.MyString = StrConv(me.MyString, vbProperCase)

It didn't work!!
I am just a novice when it comes to this.

1. I opened my Data table then I went to design view.
2. In the Lower box where it says General or Look up , I clicked on Format under General and copied the line below beside in Format.

3. The only thing that Happened is my text now aligns to the right.

4. I am doing something wrong, What??
me.MyString = StrConv(me.MyString, vbProperCase)
 
assumptions

I made the assumption (yep, I know what that means) that you were entering your data through a form. So, in the afterupdate event of that field you could place the above code.
 
Rickster57 said:
I made the assumption (yep, I know what that means) that you were entering your data through a form. So, in the afterupdate event of that field you could place the above code.
Told you I am dense. Here is the box where I am trying to insert the info so my Data comes out with the first letter of each word in Upper Case.

Can you just tell me where to input and what I should type. Thank you for being patient.
accessbox.jpg
 
Past This function into a module then use the call below to
Code:
Function ProperCase(AnyText) As String
'If passed value is a null, ignore all the stuff below.
If IsNull(AnyText) Then
    Exit Function
End If
  
Dim IntCounter As Integer, OneChar As String

'First convert to initial cap, followed by all lowercase.
AnyText = UCase$(Left$(AnyText, 1)) & LCase$(Mid$(AnyText, 2, 255))

'Look at each character, starting at the second character.
For IntCounter = 2 To Len(AnyText)
    OneChar = Mid$(AnyText, IntCounter, 1)
    'If current character (OneChar) is a space or hyphen...
    If OneChar = " " Or OneChar = "-" Then
        '...convert the character after space/hyphen to uppercase.
        AnyText = Left$(AnyText, IntCounter) & UCase$(Mid$(AnyText, IntCounter + 1, 1)) & Mid$(AnyText, IntCounter + 2, 255)
    End If
Next

'All done, return current contents of AnyText variable.
ProperCase = AnyText
End Function

Call Like
Code:
Private Sub NameOfYourControl_AfterUpdate()
Me![NameOfYourControl] = ProperCase(Me![NameOfYourControl])
End Sub

No Credit to me found this just too many years gone by to remember where LOL
 
I really don't understand what you are telling me.

Can you give the steps on how or where to paste the info that is in the Box Code:

Then I see there is another box that says Code Like:

Could you please show me using an example. That would be very beneficial.:confused:
 
I don't think you can do it in Format.

What Rickster and Dreamweaver are suggesting is changing the design of your Form, and adding a code Module.
 
For this
me.MyString = StrConv(me.MyString, vbProperCase)

I had to code
me.MyString = StrConv(me.MyString, 3)

The difference between the 2 approaches is that Dreamweavers code capitalises after hyphens.
rosemere I have used both approaches in the sample attached I hope it helps

Brian
 

Attachments

I see that you are writing the code in the format, did you really look at my DB thoroughly, examine the input forms , look at the properties of the text boxes, scroll to the afterupdate event , click on the ... and look at the code, look also at module1.

Brian
 
rosemere,look at

Look at your the forms in design view, select the form (you'll see the left hand corner has a black square on it when form is selected). Right click, then look at the bottom of the menu that opens for Properties. You'll see the code written in this section.
 
I am going to attach the access file. Can you in the area that is Text for Golf course and street address insert the proper code and that way I will have the title caps.

Thank you for being so patient with this slooooooooo lady.
 

Attachments

A query

You can not use the format in the table to do this.

I created a query for you Golf Club Data Query that does what you need.
Open the query and scroll all the way over to the right. You wil see the wtwo fields in proper case.
 

Attachments

Thanks for trying but when I opened your Query record # 286 & # 287 do not have address or the name of the golf course with Title Caps. So I guess there might be something wrong with my professional access 2003. Any ideas what I should try?
 
I am trying to not let my frustration turn to anger but you appear to have ignored all of the information given to you in this thread. I opened your database, where is the form? where is the code? You have been told by a number of posters that you need to do this via code and a form, my little database illustrated this, if you have problems doing this then ask, it benefits you little to have somebody do the work and you not understanding how.

However I have inserted a code module and done the work for the golf club name, you need to do the class modules, ie the code, for any other text boxes you wish to apply the propercase function to.
Note that Alt+f11 opens up the VBA editor so that you can look at the current code, also I have added two records as I tested.

Brian
 

Attachments

I have not ignored you but obviously I have a pea size brain. If you are that frustrated Please don't bother I don't want you upset. We all know Access isn't easy and yes I put codes in but also removed as they didn't seem to work. Will try your zip. Thanks.
 
I apologise for the tone of my previous post, I'm sure that you do not have apea sized brain :) , nothing is obvious to those who do not know, so if you have difficulty with the Afterupdate event or the class module code please ask.

Brian
 
Access

Per your comment :Please don't use very complicated software language is this is possible as I don't understand a lot of the computer design jargon.


If I may, I think before you proceed any further you should buy a beginner's Access book to become familiar with tables, queries, forms, etc.., if you have not already done so.:)

Once you have gone through the chapters everything that has been posted here will become pretty clear. We can post suggestions on what you can do but it is not very meaningful until you become familiar with the basic concepts of Access.

Most of us started with the Access For Dummies and proceeded to intermediate and then advanced books. The talented programmers (excluding myself of course) in this forum have spent years studying and writing Access code.

I also don't think you have a pea sized brain, just inexperienced using Access. Stick with it, it is a very powerful programming tool
 
Last edited:
I believe one of the issues is I am or was inserting data in Table and I thought I could do something fron Design View Table.

I have opened your form and finally got to VB "after update". I saw the code you inserted. Never was I here before. Obviously I am very novice when it comes to Access.

A couple of questions : Should I only insert data from the form view?

And if I have another access data base do I insert in afterdate for all in the Text box?

I am going out for awhile, and will try this again when I return. Maybe the light bulb is gradually coming on!!!
 

Users who are viewing this thread

Back
Top Bottom