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

Query result in a textfield VBA

Status
Not open for further replies.

kpetas

Programmer
Oct 19, 2006
11
ES
I have this code:

Private Sub codProyecto_Change()
Dim strSQL As String

strSQL = "SELECT *"
strSQL = strSQL & "FROM Proyecto "
strSQL = strSQL & "WHERE [Nombre proyecto]='" & codProyecto.Text & "'"

Me.lstResultado.RowSource = strSQL

End Sub

This code take a name for a TextField(codProyecto) and show de query in a listbox(lstResultado), now I want to show the result of the query in a textfield in spite of in a listbox, Thnak you
 
In Access VBA you may consider the DLookUp function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top