Requery an Open Query from a Form, Use Isloaded to test if Query is already open
Posted on 2007-12-06
I have a simple form with an unbound text box and a button that opens a calendar form. The user selects the date from the pop-up calendar and it is entered into the textbox. There is a query that uses the date from that unbound textbox as part of a calculated field that uses the iPmt Function.
I have a number of problems based on what I am trying to do with the above.
1) When I change the date in the textbox using the pop-up calendar, it does not trigger the afterupdate event of the textbox.
2) If the query isn't already open, I would like to open the query after the textbox has been updated. (Can't make isloaded with a query work)
3) If the query is already open, I would like it to "requery" (I can't seem to make that happen based on the afterupdate event of the unbound textbox not triggering). If that is not possible, I would like to test for the query already being open, close it, and open it again. (isloaded?)
I have plenty more issues, but this will get me started. I have searched the EE for Requery info, and found some, but didn't answer my questions. I really would like to know how to use IsLoaded with a query, and be able to requery an open query if possible.
Below was my attempt at isloaded, based on help files etc. I am afraid I am just plain lost here.
If CurrentData.AllQueries(qryIntDue).IsLoaded = False Then
When I tried the above, it tested as false whether or not the query was open.
Thanks for any help that can be given.