updatable and changable row source

G

Guest

In my form that contain one text box (unbound) at the top and one list box in
down, when I start the typing in the text box the row source of list box that
is the query that depend on the text box (parameter) automatically updated
and show the records in the list box.

Best regards.
 
M

Marshall Barton

Masoud said:
In my form that contain one text box (unbound) at the top and one list box in
down, when I start the typing in the text box the row source of list box that
is the query that depend on the text box (parameter) automatically updated
and show the records in the list box.


That's awfully vague, but the general idea would be to use
the text box's Change event to reconstruct the row source
SQL statement using the text box's Text property. Then
stuff the SQL string into the list box's RowSource property.
 
G

Guest

Marshall Barton said:
That's awfully vague, but the general idea would be to use
the text box's Change event to reconstruct the row source
SQL statement using the text box's Text property. Then
stuff the SQL string into the list box's RowSource property.
I like to do this event wih keyup_ event or change_event but I don't know how?
if you know please send to me.(my previouse question was not complete)
 
M

Marshall Barton

Masoud said:
I like to do this event wih keyup_ event or change_event but I don't know how?
if you know please send to me.(my previouse question was not complete)


You really should provide sufficient details to help me
understand exactly what you are trying to accomplish. All I
can do at this point is provide a general air code example
of the text box's Change event procedure:

Dim strSQL As String

strSQL = "SELECT fieldlist FROM sometable " & _
"WHERE somefield Like ""*" & Me.thetextbox.Text & "*"""
Me.thelistbox.RowSource = strSQL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top