Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Initials


Hi, I am making this program which allows the user to enter their first and last names and it displays their initials in uppercase after the command button is clicked. The problem is I can only have the initials displayed in lowercase or the entire name is displayed. Can anyone tell me how to combine the two statements to work? Thanx!


strFName = txtInput.Text
lblAnswer.Caption = UCase(strFName)

strLName = txtInput.Text
lblAnswer.Caption = Left (strFName, 1)




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Initials
Ok ... for my CHS (College in Highschool) VB class i have to make a score sheet for a team of four golfers and record then to golf.doc. I got all for the rogram working except one thing. When the user enters a golf course it the program is supposted to generate a code to go along with it. This code is supposed to be three (3) letters long and can only be letters. It is supposted to be the first, middle and last initials of the courses name.

for example:

if Pittsburgh Greens House Golf Course was evtered the code for it would be PGH

my question is can someone help me find a way to code this? I tried doing loops to search for spaces then taking hte letter after the space (using the left function) which i thought would work great, but for some reason it didn't.

Search With Initials
This is my code to find phone number in database using Firstname and lastname :

Private Sub btn_Find_Click()
Dim v_sSQL As String
Dim v_rsFind As New Recordset
Dim v_iLoop As Integer
Dim v_sActiveConnection As String
Dim v_iIndex As Integer

On Error GoTo Err

frm_Find.lvw_Find.ListItems.Clear

v_sActiveConnection = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "PhoneBook.mdb"
v_sSQL = "SELECT * FROM PhoneBook WHERE "

If frm_Find.tbx_FirstName.Text <> "" Then
v_sSQL = v_sSQL & "FirstName LIKE '" & frm_Find.tbx_FirstName.Text & "' AND "
End If

If frm_Find.tbx_LastName.Text <> "" Then
v_sSQL = v_sSQL & "LastName LIKE '" & frm_Find.tbx_LastName.Text & "' AND "
End If

If frm_Find.tbx_TelNo.Text <> "" Then
v_sSQL = v_sSQL & "TelNo LIKE '" & frm_Find.tbx_TelNo.Text & "' AND "
End If

If frm_Find.tbx_EMail.Text <> "" Then
v_sSQL = v_sSQL & "EMail LIKE '" & frm_Find.tbx_EMail.Text & "' AND "
End If




v_sSQL = Left(v_sSQL, Len(v_sSQL) - 5)
v_rsFind.Open v_sSQL, v_sActiveConnection

While Not v_rsFind.EOF
v_iIndex = v_iIndex + 1
frm_Find.lvw_Find.ListItems.Add , , v_rsFind.Fields!FirstName
frm_Find.lvw_Find.ListItems(v_iIndex).ListSubItems.Add 1, , v_rsFind.Fields!LastName
frm_Find.lvw_Find.ListItems(v_iIndex).ListSubItems.Add 2, , v_rsFind.Fields!TelNo
v_rsFind.MoveNext
Wend
Exit Sub

Err:
MsgBox Err.Description, vbCritical
End Sub

But Now i've to search phone number in database using initials, for example, my name is feroz khan, i must be able to search using F or K or both accordingly to the text boxes. Please help me to finsh the coding. i'm running out of time. thank you.

Display Initials Of A Name...
i have an app where i need to display just the middle initials of a physician. suppose the name is Mark J Anthony MD. i receive this name from teh server as a string. i need to display this, as MJAMD.

similarly, if the name is Mark Anthony MD, i need to display it as MAMD.
or, if the name is Mark J Anthony, then need to display it as MJA.
or, if the name is Mark Anthony, then need to display it as MA.

any help please? this is quite urgent. thanx

Find The Initials In A 3 Word Name
Im new here and having trouble getting this one program to work. I found a questionon this site here which is just like what i need to do, but i need to find the first letters of the 3 words in the textbox. omeone showed me how to do it with functions, but that didnt help because i dont know functions.

so if somone could explaing it to me, id really apperciate it.

thanks

Access Query From Vb6 Return Initials
Is there any function that i can use in my access query to return only initials of a first name.

The first name field can contain two first name for example David John and i want it should return
D. J.


Is there any way this can be done?


Thanks for your help.

"Initials" Project
I just need help with coding for an initials project. I have to create an initials application that allows the user to enter his or her first and last names and then it will display the initials of the name in uppercase.

If someone can help it will be greatly appreciated.

Copyright 2005-08 www.BigResource.com, All rights reserved