PC Review


Reply
Thread Tools Rate Thread

vbProperCase not working

 
 
UnknownJoe
Guest
Posts: n/a
 
      16th Sep 2009
I have a form that allows for data entry of high school courses. Within the
form is a field called Course_Name that I would like to apply vbPropercase so
any word(s) entered within the field are converted to "Capital Letters for
each word entered" - ex. introduction to physics = Introduction To Physics.
I put in the following code on the Course_Name field but it doesn't seem to
work. I entered data in the field and still no capital letters.

Private Sub Course_Name_AfterUpdate()
Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
End Sub

Would there be any problems caused by property settings within the form
itself?

Any help would be appreciated.
Thanks.
 
Reply With Quote
 
 
 
 
Gina Whipp
Guest
Posts: n/a
 
      16th Sep 2009
UnknownJoe,

Try... Me.Course_Name = StrConv(Me.Course_Name, 3)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"UnknownJoe" <(E-Mail Removed)> wrote in message
news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
>I have a form that allows for data entry of high school courses. Within the
> form is a field called Course_Name that I would like to apply vbPropercase
> so
> any word(s) entered within the field are converted to "Capital Letters for
> each word entered" - ex. introduction to physics = Introduction To
> Physics.
> I put in the following code on the Course_Name field but it doesn't seem
> to
> work. I entered data in the field and still no capital letters.
>
> Private Sub Course_Name_AfterUpdate()
> Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
> End Sub
>
> Would there be any problems caused by property settings within the form
> itself?
>
> Any help would be appreciated.
> Thanks.



 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      16th Sep 2009
Double check the Name of this text box. You may have a field named
Course_Name, but the text box might be something else (such as Text0.) You
need to use the text box name.

Double check that the AfterUpdate property of the text box is set to:
[Event Procedure]

Temporarily add another line such as:
Debug.Print "Course_Name_AfterUpdate() at " & Now()
Then when you expected it to run, open the Immediate Window (Ctrl+G) and see
if the procedure ran at all.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"UnknownJoe" <(E-Mail Removed)> wrote in message
news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
> I have a form that allows for data entry of high school courses. Within
> the
> form is a field called Course_Name that I would like to apply vbPropercase
> so
> any word(s) entered within the field are converted to "Capital Letters for
> each word entered" - ex. introduction to physics = Introduction To
> Physics.
> I put in the following code on the Course_Name field but it doesn't seem
> to
> work. I entered data in the field and still no capital letters.
>
> Private Sub Course_Name_AfterUpdate()
> Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
> End Sub
>
> Would there be any problems caused by property settings within the form
> itself?
>
> Any help would be appreciated.
> Thanks.


 
Reply With Quote
 
UnknownJoe
Guest
Posts: n/a
 
      16th Sep 2009
Interesting enough, I created a DUMMY db with one table called Student.
Within the table, there is an ID and Student Name field.

I created a simple form, named Student, to add records to the table.
When I use the form to add records, the vbProperCase function works perfectly.

However, when I exit the DB and then restart, open the form and add new
records, the function doesn't work anymore.

Any ideas?

"Allen Browne" wrote:

> Double check the Name of this text box. You may have a field named
> Course_Name, but the text box might be something else (such as Text0.) You
> need to use the text box name.
>
> Double check that the AfterUpdate property of the text box is set to:
> [Event Procedure]
>
> Temporarily add another line such as:
> Debug.Print "Course_Name_AfterUpdate() at " & Now()
> Then when you expected it to run, open the Immediate Window (Ctrl+G) and see
> if the procedure ran at all.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> "UnknownJoe" <(E-Mail Removed)> wrote in message
> news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
> > I have a form that allows for data entry of high school courses. Within
> > the
> > form is a field called Course_Name that I would like to apply vbPropercase
> > so
> > any word(s) entered within the field are converted to "Capital Letters for
> > each word entered" - ex. introduction to physics = Introduction To
> > Physics.
> > I put in the following code on the Course_Name field but it doesn't seem
> > to
> > work. I entered data in the field and still no capital letters.
> >
> > Private Sub Course_Name_AfterUpdate()
> > Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
> > End Sub
> >
> > Would there be any problems caused by property settings within the form
> > itself?
> >
> > Any help would be appreciated.
> > Thanks.

>
>

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      16th Sep 2009
UnknownJoe,

Doesn't work anymore is kind of vague... Also, I would check that Name Auto
Correct is unchecked. (Go to Tools - Options - General tab)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"UnknownJoe" <(E-Mail Removed)> wrote in message
news:0BB85863-6308-44E4-8C78-(E-Mail Removed)...
> Interesting enough, I created a DUMMY db with one table called Student.
> Within the table, there is an ID and Student Name field.
>
> I created a simple form, named Student, to add records to the table.
> When I use the form to add records, the vbProperCase function works
> perfectly.
>
> However, when I exit the DB and then restart, open the form and add new
> records, the function doesn't work anymore.
>
> Any ideas?
>
> "Allen Browne" wrote:
>
>> Double check the Name of this text box. You may have a field named
>> Course_Name, but the text box might be something else (such as Text0.)
>> You
>> need to use the text box name.
>>
>> Double check that the AfterUpdate property of the text box is set to:
>> [Event Procedure]
>>
>> Temporarily add another line such as:
>> Debug.Print "Course_Name_AfterUpdate() at " & Now()
>> Then when you expected it to run, open the Immediate Window (Ctrl+G) and
>> see
>> if the procedure ran at all.
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>>
>> "UnknownJoe" <(E-Mail Removed)> wrote in message
>> news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
>> > I have a form that allows for data entry of high school courses. Within
>> > the
>> > form is a field called Course_Name that I would like to apply
>> > vbPropercase
>> > so
>> > any word(s) entered within the field are converted to "Capital Letters
>> > for
>> > each word entered" - ex. introduction to physics = Introduction To
>> > Physics.
>> > I put in the following code on the Course_Name field but it doesn't
>> > seem
>> > to
>> > work. I entered data in the field and still no capital letters.
>> >
>> > Private Sub Course_Name_AfterUpdate()
>> > Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
>> > End Sub
>> >
>> > Would there be any problems caused by property settings within the form
>> > itself?
>> >
>> > Any help would be appreciated.
>> > Thanks.

>>
>>



 
Reply With Quote
 
UnknownJoe
Guest
Posts: n/a
 
      16th Sep 2009
Very odd indeed. I am using Access 2007 but found the same feature you are
referring to and still does not work.

Even tried the following:

Public Sub ConvertToProper()
If IsNull(Screen.ActiveControl) = False Then
Screen.ActiveControl = StrConv(Screen.ActiveControl, vbProperCase)
End If
End Sub

Private Sub Student_Name_AfterUpdate()
ConvertToProper
End Sub

Driving me crazy! Ahh!

"Gina Whipp" wrote:

> UnknownJoe,
>
> Doesn't work anymore is kind of vague... Also, I would check that Name Auto
> Correct is unchecked. (Go to Tools - Options - General tab)
>
> --
> Gina Whipp
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
>
> "UnknownJoe" <(E-Mail Removed)> wrote in message
> news:0BB85863-6308-44E4-8C78-(E-Mail Removed)...
> > Interesting enough, I created a DUMMY db with one table called Student.
> > Within the table, there is an ID and Student Name field.
> >
> > I created a simple form, named Student, to add records to the table.
> > When I use the form to add records, the vbProperCase function works
> > perfectly.
> >
> > However, when I exit the DB and then restart, open the form and add new
> > records, the function doesn't work anymore.
> >
> > Any ideas?
> >
> > "Allen Browne" wrote:
> >
> >> Double check the Name of this text box. You may have a field named
> >> Course_Name, but the text box might be something else (such as Text0.)
> >> You
> >> need to use the text box name.
> >>
> >> Double check that the AfterUpdate property of the text box is set to:
> >> [Event Procedure]
> >>
> >> Temporarily add another line such as:
> >> Debug.Print "Course_Name_AfterUpdate() at " & Now()
> >> Then when you expected it to run, open the Immediate Window (Ctrl+G) and
> >> see
> >> if the procedure ran at all.
> >>
> >> --
> >> Allen Browne - Microsoft MVP. Perth, Western Australia
> >> Tips for Access users - http://allenbrowne.com/tips.html
> >> Reply to group, rather than allenbrowne at mvps dot org.
> >>
> >>
> >> "UnknownJoe" <(E-Mail Removed)> wrote in message
> >> news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
> >> > I have a form that allows for data entry of high school courses. Within
> >> > the
> >> > form is a field called Course_Name that I would like to apply
> >> > vbPropercase
> >> > so
> >> > any word(s) entered within the field are converted to "Capital Letters
> >> > for
> >> > each word entered" - ex. introduction to physics = Introduction To
> >> > Physics.
> >> > I put in the following code on the Course_Name field but it doesn't
> >> > seem
> >> > to
> >> > work. I entered data in the field and still no capital letters.
> >> >
> >> > Private Sub Course_Name_AfterUpdate()
> >> > Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
> >> > End Sub
> >> >
> >> > Would there be any problems caused by property settings within the form
> >> > itself?
> >> >
> >> > Any help would be appreciated.
> >> > Thanks.
> >>
> >>

>
>
>

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      16th Sep 2009
Very odd and I am now going to open Access 2007 and see what happens when I
try...

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"UnknownJoe" <(E-Mail Removed)> wrote in message
news:762ADBC9-4A25-405E-A3B6-(E-Mail Removed)...
> Very odd indeed. I am using Access 2007 but found the same feature you are
> referring to and still does not work.
>
> Even tried the following:
>
> Public Sub ConvertToProper()
> If IsNull(Screen.ActiveControl) = False Then
> Screen.ActiveControl = StrConv(Screen.ActiveControl, vbProperCase)
> End If
> End Sub
>
> Private Sub Student_Name_AfterUpdate()
> ConvertToProper
> End Sub
>
> Driving me crazy! Ahh!
>
> "Gina Whipp" wrote:
>
>> UnknownJoe,
>>
>> Doesn't work anymore is kind of vague... Also, I would check that Name
>> Auto
>> Correct is unchecked. (Go to Tools - Options - General tab)
>>
>> --
>> Gina Whipp
>>
>> "I feel I have been denied critical, need to know, information!" -
>> Tremors
>> II
>>
>> http://www.regina-whipp.com/index_files/TipList.htm
>>
>> "UnknownJoe" <(E-Mail Removed)> wrote in message
>> news:0BB85863-6308-44E4-8C78-(E-Mail Removed)...
>> > Interesting enough, I created a DUMMY db with one table called Student.
>> > Within the table, there is an ID and Student Name field.
>> >
>> > I created a simple form, named Student, to add records to the table.
>> > When I use the form to add records, the vbProperCase function works
>> > perfectly.
>> >
>> > However, when I exit the DB and then restart, open the form and add new
>> > records, the function doesn't work anymore.
>> >
>> > Any ideas?
>> >
>> > "Allen Browne" wrote:
>> >
>> >> Double check the Name of this text box. You may have a field named
>> >> Course_Name, but the text box might be something else (such as Text0.)
>> >> You
>> >> need to use the text box name.
>> >>
>> >> Double check that the AfterUpdate property of the text box is set to:
>> >> [Event Procedure]
>> >>
>> >> Temporarily add another line such as:
>> >> Debug.Print "Course_Name_AfterUpdate() at " & Now()
>> >> Then when you expected it to run, open the Immediate Window (Ctrl+G)
>> >> and
>> >> see
>> >> if the procedure ran at all.
>> >>
>> >> --
>> >> Allen Browne - Microsoft MVP. Perth, Western Australia
>> >> Tips for Access users - http://allenbrowne.com/tips.html
>> >> Reply to group, rather than allenbrowne at mvps dot org.
>> >>
>> >>
>> >> "UnknownJoe" <(E-Mail Removed)> wrote in message
>> >> news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
>> >> > I have a form that allows for data entry of high school courses.
>> >> > Within
>> >> > the
>> >> > form is a field called Course_Name that I would like to apply
>> >> > vbPropercase
>> >> > so
>> >> > any word(s) entered within the field are converted to "Capital
>> >> > Letters
>> >> > for
>> >> > each word entered" - ex. introduction to physics = Introduction To
>> >> > Physics.
>> >> > I put in the following code on the Course_Name field but it doesn't
>> >> > seem
>> >> > to
>> >> > work. I entered data in the field and still no capital letters.
>> >> >
>> >> > Private Sub Course_Name_AfterUpdate()
>> >> > Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
>> >> > End Sub
>> >> >
>> >> > Would there be any problems caused by property settings within the
>> >> > form
>> >> > itself?
>> >> >
>> >> > Any help would be appreciated.
>> >> > Thanks.
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      16th Sep 2009
Okay, I have tried this and your original line works perfectly in mine. I
have Access 2007 with SP2 installed. Even read this
http://allenbrowne.com/Access2007.html and found nothing, so far, like you
are describing!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Gina Whipp" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Very odd and I am now going to open Access 2007 and see what happens when
> I try...
>
> --
> Gina Whipp
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
>
> "UnknownJoe" <(E-Mail Removed)> wrote in message
> news:762ADBC9-4A25-405E-A3B6-(E-Mail Removed)...
>> Very odd indeed. I am using Access 2007 but found the same feature you
>> are
>> referring to and still does not work.
>>
>> Even tried the following:
>>
>> Public Sub ConvertToProper()
>> If IsNull(Screen.ActiveControl) = False Then
>> Screen.ActiveControl = StrConv(Screen.ActiveControl, vbProperCase)
>> End If
>> End Sub
>>
>> Private Sub Student_Name_AfterUpdate()
>> ConvertToProper
>> End Sub
>>
>> Driving me crazy! Ahh!
>>
>> "Gina Whipp" wrote:
>>
>>> UnknownJoe,
>>>
>>> Doesn't work anymore is kind of vague... Also, I would check that Name
>>> Auto
>>> Correct is unchecked. (Go to Tools - Options - General tab)
>>>
>>> --
>>> Gina Whipp
>>>
>>> "I feel I have been denied critical, need to know, information!" -
>>> Tremors
>>> II
>>>
>>> http://www.regina-whipp.com/index_files/TipList.htm
>>>
>>> "UnknownJoe" <(E-Mail Removed)> wrote in message
>>> news:0BB85863-6308-44E4-8C78-(E-Mail Removed)...
>>> > Interesting enough, I created a DUMMY db with one table called
>>> > Student.
>>> > Within the table, there is an ID and Student Name field.
>>> >
>>> > I created a simple form, named Student, to add records to the table.
>>> > When I use the form to add records, the vbProperCase function works
>>> > perfectly.
>>> >
>>> > However, when I exit the DB and then restart, open the form and add
>>> > new
>>> > records, the function doesn't work anymore.
>>> >
>>> > Any ideas?
>>> >
>>> > "Allen Browne" wrote:
>>> >
>>> >> Double check the Name of this text box. You may have a field named
>>> >> Course_Name, but the text box might be something else (such as
>>> >> Text0.)
>>> >> You
>>> >> need to use the text box name.
>>> >>
>>> >> Double check that the AfterUpdate property of the text box is set to:
>>> >> [Event Procedure]
>>> >>
>>> >> Temporarily add another line such as:
>>> >> Debug.Print "Course_Name_AfterUpdate() at " & Now()
>>> >> Then when you expected it to run, open the Immediate Window (Ctrl+G)
>>> >> and
>>> >> see
>>> >> if the procedure ran at all.
>>> >>
>>> >> --
>>> >> Allen Browne - Microsoft MVP. Perth, Western Australia
>>> >> Tips for Access users - http://allenbrowne.com/tips.html
>>> >> Reply to group, rather than allenbrowne at mvps dot org.
>>> >>
>>> >>
>>> >> "UnknownJoe" <(E-Mail Removed)> wrote in message
>>> >> news:4C1DFAEF-BDF6-4373-AA00-(E-Mail Removed)...
>>> >> > I have a form that allows for data entry of high school courses.
>>> >> > Within
>>> >> > the
>>> >> > form is a field called Course_Name that I would like to apply
>>> >> > vbPropercase
>>> >> > so
>>> >> > any word(s) entered within the field are converted to "Capital
>>> >> > Letters
>>> >> > for
>>> >> > each word entered" - ex. introduction to physics = Introduction To
>>> >> > Physics.
>>> >> > I put in the following code on the Course_Name field but it doesn't
>>> >> > seem
>>> >> > to
>>> >> > work. I entered data in the field and still no capital letters.
>>> >> >
>>> >> > Private Sub Course_Name_AfterUpdate()
>>> >> > Me.Course_Name = StrConv(Me.Course_Name, vbProperCase)
>>> >> > End Sub
>>> >> >
>>> >> > Would there be any problems caused by property settings within the
>>> >> > form
>>> >> > itself?
>>> >> >
>>> >> > Any help would be appreciated.
>>> >> > Thanks.
>>> >>
>>> >>
>>>
>>>
>>>

>
>



 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      16th Sep 2009
"UnknownJoe" <(E-Mail Removed)> wrote in message
news:0BB85863-6308-44E4-8C78-(E-Mail Removed)...
> Interesting enough, I created a DUMMY db with one table called Student.
> Within the table, there is an ID and Student Name field.
>
> I created a simple form, named Student, to add records to the table.
> When I use the form to add records, the vbProperCase function works
> perfectly.
>
> However, when I exit the DB and then restart, open the form and add new
> records, the function doesn't work anymore.
>
> Any ideas?



It sounds to me as though VBA code is disabled in this database. Is it in a
trusted location? When you open it, do you get a message or notification
about disabled content?

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      16th Sep 2009
Of all the... Thanks Dirk, that is probably it! I missed the forest for
the trees!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Dirk Goldgar" <(E-Mail Removed)> wrote in message
news:0EE15454-A468-4201-8BD9-(E-Mail Removed)...
> "UnknownJoe" <(E-Mail Removed)> wrote in message
> news:0BB85863-6308-44E4-8C78-(E-Mail Removed)...
>> Interesting enough, I created a DUMMY db with one table called Student.
>> Within the table, there is an ID and Student Name field.
>>
>> I created a simple form, named Student, to add records to the table.
>> When I use the form to add records, the vbProperCase function works
>> perfectly.
>>
>> However, when I exit the DB and then restart, open the form and add new
>> records, the function doesn't work anymore.
>>
>> Any ideas?

>
>
> It sounds to me as though VBA code is disabled in this database. Is it in
> a trusted location? When you open it, do you get a message or
> notification about disabled content?
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips: www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
StrConv and vbProperCase Question Boy Microsoft Access VBA Modules 3 12th Feb 2008 06:55 PM
Re: VBProperCase for Memo Controls? fredg Microsoft Access VBA Modules 1 12th Dec 2006 09:12 PM
I need to code vbProperCase =?Utf-8?B?ZWR3YXJkIGtlaXRo?= Microsoft Access Form Coding 3 13th Nov 2005 10:23 PM
Surprise in StrConv using vbProperCase Gary Schuldt Microsoft Access VBA Modules 11 10th Nov 2004 12:58 PM
vbProperCase =?Utf-8?B?U3Vl?= Microsoft Access Form Coding 11 9th Jun 2004 08:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:35 AM.