Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combine two text boxes into one combo box

Status
Not open for further replies.

JackBurton07

IS-IT--Management
Oct 17, 2007
75
GB
Hi I want to combine firstname.text and surname.text so that the fullname will be displayed in a combo box that is used for searching

how can i combine these two text box values so that the full name is in the combo

e.g

First Name : Bob
Surname: Smith

Quick Search:(combo box) Bob Smith
 
Hi

How are you getting your data?

If its from a database then use something like this

Select Forename + " " + Surname as Name From Mytable

Cheers
 
the data is coming from access db

myRecordSet.Open("Select* from client where firstname and surname ='" & cboclient.Text & "'", myDb)

is this correct?

thanks
 
Hi

Im not sure your select is going to work as you are looking for a firstname and a surname = to cboclient.Text

Are you trying to populate a combo box from a database and combining the firstname and surname?

If so this should work

Dim myString as string

myString = "Select firstname & " " & Surname as Fullname from client", myDb)

myRecordSet.Open(myString, myDb)


Try That
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top