|
-
December 5th, 1999, 03:24 PM
#1
name function
I have a function that will return an inputted name in proper case as long as a middle initial is included. It fails if only a first name and last name is entered. Validation forces letters and spaces. Can anyone help with the needed code to display properly even if no middle initial is entered.
CStr(Text2.Text)
-
December 6th, 1999, 03:10 AM
#2
Re: name function
Try something like that:
If Text2.Text <> "" Then MyText = MyText & CStr(Text2.Text)
In this condition you'll check, if your textbox is not empty.
Good Luck!
-
December 7th, 1999, 11:25 AM
#3
Re: name function
Kyler,
Here is additional code for you to use.
Dim strIn As String
Dim astrIn() As String
Dim strOut As String
Dim I As Integer
strIn = "allen d echo f g noakes"
strIn = StrConv(strIn, vbProperCase)
astrIn = Split(strIn, " ")
For I = LBound(astrIn) To UBound(astrIn)
If Len(astrIn(I)) = 1 Then
astrIn(I) = astrIn(I) & "."
End If
strOut = strOut & " " & astrIn(I)
Next
Allen Noakes
VB Programmer/Analyst
Dames & Moore Group
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|