Re: Uppercase to Mixed Case Edit in Field
- From: "sara" <saraqpost@xxxxxxxxx>
- Date: 8 Aug 2006 13:29:53 -0700
Thanks, gumby. Maybe I'm not being clear.
I have 2 problems:
1. The field is ONE field: Vendor. It may have a company name (ABC
Corp) or it may have a person's name (JOE SMITH). I want to end up
with [ABC Corp] and [Joe Smith] by allowing the user to edit.
2. Every time I try to change, the system tells me I'm trying to add a
duplicate record. I want to change JOE SMITH to Joe Smith, so I'm not
even sure the after update code is the right thing to do.
Here's the code I wrote, and it does execute, but I get a dup message
(I don't allow the same vendor name to be added).
Private Sub txtVendor_AfterUpdate()
' This will force "JOE SMITH" into "Joe SMITH"
Dim strVendor As String
Dim strFirstLetter As String
Dim strRightName As String
Dim strWholeName As String
strVendor = Me.txtVendor
strFirstLetter = Left(strVendor, 1)
strRightName = Mid(strVendor, 2, 49)
strWholeName = UCase(strFirstLetter) + strRightName
Me.txtVendor = strWholeName
End Sub
Thanks
Sara
gumby wrote:
This will force the name into "Joe Smith"
Add it to the field under the afterupdate property.
Private Sub FirstName_AfterUpdate()
Me.FirstName = StrConv(FirstName, 3) ' Research StrConv Function for
more info on number to use
End Sub
Private Sub LastName_AfterUpdate()
Me.LastName = StrConv(LastName, 3) ' Research StrConv Function for
more info on number to use
End Sub
Private Sub MiddleInitial_AfterUpdate()
Me.MiddleInitial = StrConv(MiddleInitial, 3) ' Research StrConv
Function for more info on number to use
End Sub
Some code that will capitalize the first letter but not force the rest
of the letters to be lowercase.
Here it is:
Private Sub LastName_AfterUpdate()
Dim strFirstLetter As String
Dim strRightName As String
Dim strWholeName As String
strFirstLetter = Left(LastName, 1)
strRightName = Mid(LastName, 2, 49)
strWholeName = UCase(strFirstLetter) + strRightName
Me.LastName = strWholeName
End Sub
sara wrote:
I have a table where a few of the users entered vendor names ALL IN
UPPER CASE. I have created forms to edit the data, but I can't seem to
allow changing JOE SMITH to Joe Smith.
What to I have to do to have the user change the name, but keep the
key? Overall, I think any "edits" simply add a new record, rather than
change the existing record.
The form is simple - Choose the vendor from the drop-down list.
After Update, a new field displays: Vendor: [and the chosen vendor in
the field]
If the user wishes to Add a new vendor or Delete the current one, they
choose a button on the bottom of the screen and that works just fine.
The "edit" or "Change" is what doesn't work.
Don't know what code to post, so I didn't post any.
Thanks.
Sara
.
- References:
- Uppercase to Mixed Case Edit in Field
- From: sara
- Re: Uppercase to Mixed Case Edit in Field
- From: gumby
- Uppercase to Mixed Case Edit in Field
- Prev by Date: Re: Question about forms
- Next by Date: Run Time Error 3075 Missing Operator
- Previous by thread: Re: Uppercase to Mixed Case Edit in Field
- Next by thread: Re: Uppercase to Mixed Case Edit in Field
- Index(es):