Form -> Query -> Report Question

raweber

Registered User.
Local time
Today, 16:45
Joined
Jul 28, 2011
Messages
41
I have a mini-form with two combo boxes and a launch button that I use to customize a query that then feeds a report. It's a pretty straightfoward operation and works fine.

The hang-up is that on the report I have a field in the header that counts the number of records in the query and reports that number in the field. I would like to automatically close the mini-form that customizes the query, but when I do that, the query apparently resets and the count returns an error. (The report does show the correct records, however).

Is it possible to make the either query or the combo box values persistant enough to get my DCount and still close the mini-form automatically with my on-click event from the launch button?

Thanks, Rob
 
You don't spesify but it sounds like the query is reliant on data from the form hence you cannot close it without loosing the link to the data.
I don't have enough info to suggest a workaround but a simple solution might be to just make the form hidden instead of closing it.
You could then close it when you close the report at the end.
 
The answer is yes, the query is based on the values of the two combo boxes.

How would I make the form close when the report is closed if the closer just uses the red "x" to close the report. Is there an On Close event? (I suppose I could just go a look at Excel, huh?)

Thanks, Rob
 
to hide the form you can use form.visible = false or even me.visible = false

to close the form when the report closes, you would put the code behind the On Close event (in the report).
Something like:
DoCmd.close acform, "Name of Form"
 

Users who are viewing this thread

Back
Top Bottom