Refreshing a Query

BLONDIE2

New Member
Joined
Aug 12, 2004
Messages
17
I'm a newbie, so please help... :oops:

I have a very simple Access 2000 project with which I need help. I have a REPORT that runs a query that populates labels to print.

Is there a way to run the query again (that is, to refresh with different data) without having to go back to design view and return to preview?

Thanks in advance for your help.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
If you are asking what I think then the answer is a conditional no :)

are you saying that you have a report open in preview and then change something in the underlying data, you then want to refresh the view to see this ammended data.

You could probably achive this by creating a custom toolbar with a button that would close and reopen the report for you.
probably a hammer to crack a nut though.

Why do you need to do it?

Peter
 
Upvote 0
Yes, I have a report open in preview. After I print it, I want to re-run the query which will import a new set of data to print.

NONE of this data is to be saved--only inserted in the report in order to print. (somewhat like a page of mailing labels for a single addressee, which is pulled--via query--by entering a unique ID number)

I know how to do this inExcel, but Excel won't print a page of labels like access will. :unsure:

Any ideas? Thanks for your interest.
 
Upvote 0
just close it and open it again, once you have the confidence the system is working you should not need to preview it any way! just print change your criteria and print again.

peter
 
Upvote 0
That's what I don't know how to do---to change the criteria (Re-enter the ID Number) WITHOUT closing the whole thing down again.
 
Upvote 0
I dont think that you can, access even recalculates everthing again before it prints when you are in preview.
How are you entering the ID's anyway?

Peter
 
Upvote 0
There's a query that runs when the report is opened.

Is there any way to run the query with a button or something?
 
Upvote 0
How is the query oicking up which ID to run? are you hard codding it in each time?

the best way is to add a field to a form then you can link the criteria field of the query to that field and set your ID that way.

so assuming a form called frmReports with a field called txtID to hold you ID then instead of adding the id in the criteria you would have

[Forms]![frmReports]![txtId]

Then you just add a Button to the form to print your report

Peter
 
Upvote 0
A query is tied to the REPORT (Not FORM if it makes any difference) under Data Tab--Record Source. When opening the record, a pop-up box asks for the ID number. Entering the ID number and pressing enter populates the whole page, and all you have to do is press PRINT.

If a button could be placed that the button itself did NOT print (I've tried placing a Command Button off the Toolbox, but it prints on the label) it would help.

It would be fine to click a button that would print the labels AND query to call for a new ID number (but I wouldn't want a picture of the button to print on the labels)
 
Upvote 0
The button and a field for the ID go on a form, the user fills in the ID in the box and clicks the button and the report prints out. No need to preview.

You could build the ID number from a combo box if that makes it easier for the user.

so as I said before, you can replace your criteria in the query with a link to the form that you use to control printing.

if you download the sample databse from MS you will find examples of this sort of thing in the form "Customer Labels Dialog"
http://www.microsoft.com/downloads/...72-8DBE-422B-8676-C632D66C529C&displaylang=EN

HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,810
Messages
6,162,108
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top