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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box CONCAT on database

Status
Not open for further replies.

jschwick

Programmer
Apr 2, 2002
2
AU
I'm wanting to get multiple fields of my database to be displayed in a combo box using the CONCAT function. How would i go about doing this???

 
Hi,

I suppose you want to retrieve multiple fields of the same table and put them together in a simple combobox
You could go about it like this.
**********************************
Dim myConn as New ADODB.Connection
Dim MyRS as New ADODB.Recordset

myConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database\Test.mdb"
myRS.Open "SELECT * From myTbl", myConn, adOpenStatic, adLockPessimistic
myRS.Requery
With myRS
Do Until .EOF
cboCombo.AddItem !Name & " " & !ForeName
.MoveNext
Loop
End With
myRS.Close
myConn.Close

*******************************************************

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top