unbound textbox on form

C

Carlee

Hi there,

I have an unbound text box which users can enter an issue number. When the
'display results' button is clicked, the query opens wiht the filtered
information.

Problem:
when the text box value is changed, it isn't reflected in the query result
set. I have tried adding me.txtIssueNumber.requery to the After_Update
event, but it changes the value at the wrong time. For example if i change
the value and click the button, nothing changes. If i close the query and
reopen it using the button on the form, then the change shows.

How can i make the change be seen immediately?

Many thanks in advance.
 
G

George Nicholson

You need to re-open the query. Queries are not dynamic in the way you are
trying to use it. They contain a specific set of information based on the
parameters & data that existed at the time they were run/opened. If you
want to see changes, you need to open them again. In other words: requery
the query, not the textbox.

If the query is the sourceobject of a subform, requery the subform. If it
is in a window as the result of a DoCmd.OpenQuery, you need to close the
query & reopen it.

HTH,
 
R

Rick B

Another option would be to pull ALL the records to the form, then apply a
filter based on your field. changing the field and clicking your button
would turn off the filter and then apply the new filtered results.

Rick B
 
C

Carlee

thanks guys. much apprecitated.

Rick B said:
Another option would be to pull ALL the records to the form, then apply a
filter based on your field. changing the field and clicking your button
would turn off the filter and then apply the new filtered results.

Rick B
 

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