Recalc / requery list box on unbound form

G

Guest

I've searched through the discussion here, and I think I've tried everything.
I have an unbound form with an unbound list box (single selection) on it and
I cannot seem to get the list box to requery/recalc. The row source of the
list box is a query [qryTierAll2] that is made from two other queries
[qryTierAvg] and [qryTierTriggers2] BTW,all three are select/totals queries.
It narrows some of the results based on a date range selected on 2 text boxes
on the form, ie. beginDate and endDate. Narrowing the date is done in the
first queries, qryTierAvg and qryTierTriggers2. I'm using a popup calendar
(one recommended here) as an option to place the dates in the text boxes
(works great, too).
The list box has 2 uses; to rank or order student info (the tier system) and
to select the student from the list to display more detailed info in a
subform.
They way it's supposed to work is that you change the date and the list box
gets updated. You can then pick the student and see his additional info.
Everything works like it's supposed to EXCEPT that the list box will only
update after you hit F9. It does update everything, list box gives the info
I'm looking for, etc.

My typical method for updating these is to use the on update event for the
date text boxes, and use a macro or code to requery the list box. But this
just ain't workin' this time. I've tried changing the events to GotFocus,
LostFocus... I think I may have tried every event available, even putting it
on multiple events. I've even tried events on the button that pops up the
calendar.

So what am I missing here? I'm hoping someone will tell me that there's a
big on/off switch in the list box properties that I need to flip to "on".

BTW, I'm not the code king, but I can hack my way around through code...
just in case the on/off switch is not an option.

Thanks for your assistance.
Parry
 
G

Guest

Well... I figured out what I was doing wrong, so I thought I'd post back.
Using the button to call the pop-up calendar, and subsequently changing the
date, apparently didn't trigger the On Change or After Update events in the
date text boxes, even after they lost focus. I changed the event (requery of
the list box
) to happen at the On Lost Focus event on the button. When the button is
clicked, and the date changes, the focus is lost from the button, and the
query is requeried.
Thanks to anyone who has put in some thinking time on this.
Parry
 

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