Popup Form Entry Won't Clear on Close

freidaf

Registered User.
Local time
Yesterday, 20:35
Joined
Aug 13, 2012
Messages
44
I have a popup form that prompts for start and end dates before running a report. When the user enters the dates and clicks "OK" the report is displayed correctly. My problem is that once the user closes the report and runs the report again, the popup displayed has the same dates in the input fields as the last time the report was ran. How do I clear the form fields once the report has closed?

Thank you for your help.
 
You need to add a line of code to the button’s OnClick event:
Me.[YourDateField) = Null
 
Are the start and end date controls unbound?
Are you closing the popup form after you open the report?
 
Hello, Thank you both for your replies. The form Start and End dates are unbound and I close the popup when the report closes.

I tried NauticalGent's suggestion and added the code to the On Click event of the button that runs the report. When I clicked the button the popup form opened as expected with blank start and end date fields. I entered dates, ran the report, then I closed the report and ran it again and the popup opened with blank Start and End dates!!

Problem solved! Thank you so much for your help, it is MUCH appreciated.
 
You’re welcome. For the record, for some reason I was under the impression that your PU form stayed open after your report ran - but your final post leads me to beleive otherwise. If this is the case you could but that bit of code on the Form’s OnOpen or OnClose event also.

Doesn’t really make much of a difference, it just seems like a more logical place to put it, in my opinion anyway.

Glad it worked out for you.
 

Users who are viewing this thread

Back
Top Bottom