View Full Version : 2 Button Run Queries - 1 going AWOL


Becca
02-25-2002, 04:59 PM
Hi
I have a form with a couple of subforms on tabs. Each tab contains a button which (is supposed to) runs a different query in the background and refresh the data displayed in that specific subform. Button1 on Subform1 executes it all perfectly, query1 being executed in the background and subform 1 refreshed. Problem is Button2 has decided to run Query2 is the foreground ie. in my face - which is not very conducive to a pretty user interface. I have checked my code, and had someone xcheck it and I cannot work out why Button2 has decided to do it all differently when the code is almost identical. Has anyone else had this problem, and if so am I missing something, eg in the set up of the query that could be causing this. FYI I have got around the problem by adding in "docmd.close", but my screen flickers once because of the open-close execution. Thanks in advance, you guys (and gals) are great!

Pat Hartman
02-25-2002, 05:34 PM
If your subforms are bound, you don't need to run their queries separately. Just use Me.Requery in the click event of each button to get the form to run its query.

Becca
02-25-2002, 06:41 PM
Beautiful, thanks very much Pat. Obviously I was trying to be a bit over the top with the pile of stuff I typed in there. It worked great.