vbProperCase not working

U

UnknownJoe

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.
 
A

Allen Browne

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.
 
U

UnknownJoe

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 said:
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

Reply to group, rather than allenbrowne at mvps dot org.


UnknownJoe said:
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.
 
G

Gina Whipp

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 said:
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 said:
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

Reply to group, rather than allenbrowne at mvps dot org.


UnknownJoe said:
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.
 
U

UnknownJoe

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 said:
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 said:
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 said:
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

Reply to group, rather than allenbrowne at mvps dot org.


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.
 
G

Gina Whipp

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 said:
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 said:
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 said:
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?

:

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

Reply to group, rather than allenbrowne at mvps dot org.


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.
 
G

Gina Whipp

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 said:
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 said:
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 said:
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

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?

:

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

Reply to group, rather than allenbrowne at mvps dot org.


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.
 
D

Dirk Goldgar

UnknownJoe said:
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?
 
U

unknownjoe

Dirk,
It worked. You're a genius. Appreicate your help.

And also thanks to Gina and Allen for the assistance as well.

Thanks all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top