Refresh? Requery? Something like that? (1 Viewer)

markcrobinson

Registered User.
Local time
Today, 11:33
Joined
Nov 28, 2017
Messages
14
Forms!CustomerDisplay has a textbox BSearch and a combobox BsearchCombo
Enter some text in BSearch, Click on the Combobox dropdown with runs a Query on Like Besarch
Enter "mark" in Bsearch and all the records with "Mark" in it show up.
Works great -- once.

When I change the text in the BSearch Box, the query is still running on the old text "Mark" in this example.

If I exit, then reopen access -- works fine.
How do I reset it, refresh it, requery it?

Thanks!
 

markcrobinson

Registered User.
Local time
Today, 11:33
Joined
Nov 28, 2017
Messages
14
OK. And where would I put that?
On a LostFocus event on the text box didn't work
 

Isaac

Lifelong Learner
Local time
Today, 11:33
Joined
Mar 14, 2017
Messages
8,774
how about the after update event of the combobox (if I understand your setup correctly which i'm not totally sure)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 13:33
Joined
Feb 28, 2001
Messages
27,137
Mechanically, what steps in your DB actually trigger the search? What runs the query? Because the Me.Requery or Me.Refresh or whatever would go JUST BEFORE the actual step that runs the query.
 

markcrobinson

Registered User.
Local time
Today, 11:33
Joined
Nov 28, 2017
Messages
14
Ended up putting the me.refresh when the search box lost focus. Works.
The me.requery didn't.
Thank you!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:33
Joined
Feb 19, 2002
Messages
43,213
There is some other problem at play here. For this purpose, Me.Requery would do the same thing that Me.Refresh does. It makes no sense that Me.Refresh works when Me.Requery does not.

You need to examine further. Post the database if you want us to look at it.

Also, just in case this is the situation - to make this work correctly when the code is running in formA on an already open formB, you have to force formB to close and then reopen. Best to not do this at all. Just put the criteria controls on formB.
 

Users who are viewing this thread

Top Bottom