requery a query for a report based on combobox

Geordie2008

Registered User.
Local time
Today, 17:11
Joined
Mar 25, 2008
Messages
177
Afternoon ll,

How do you refresh,reload,requery the underlying queries that a report and subreports are based on?

My report opens from a buttonclick on a form based on criteria in a combobox on that form.

I selected one option from the combobox and then clicked to open the report. This works fine the first time. When I chnge the criteria and open the report again, it is based upon my first selection.....

5 of my queries are based on the value passed into the combobox on this form (using: [Forms]![frmOpenReport]![name]), and I need to requery all of them once the "Open Report" button is clicked... (which is only made visible once a name has been selected from the combobox)

How do I requery my 5 queries before opening the report when the "open report" button is clicked?

Many thanks,
Mandy
 
Are you closing the report before changing criteria, or just hiding it? Opening the report automatically runs the queries, so you shouldn't have to do anything special.
 
I realise that my problem is something quite different.

When I open the report using the button, the macro open's the report and then I closes down the form that holds the combobox.

Hence my problem is actually when I am trying to print the report, the report prints out blank as it must re-query before printing....

Is there anyway to stop this?

The reason I close the form is that I have 8 of these "filter forms" (for 8 diff reports) that all look the same so I want it to close so the user is not confused...

Thanks,
Mandy
 
I don't know of a way to stop it; the form needs to be open when you print the report. One way around it is to hide the form instead of closing it, then in the close event of the report you can close the form.
 
yeah... I though that also, but I cant find a "visible = false" control in teh properties of a form....

Is there any other way of hiding it?

Thanks,
Mandy
 
me.visible=false is working a treat.....

and prints fine,

Thanks,
Mandy
 

Users who are viewing this thread

Back
Top Bottom