Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mark Record Printed.

Status
Not open for further replies.

quig699

Technical User
Nov 7, 2006
42
US
I am looking for a way to mark a record printed in the table after it is pulled up in a report. I have tried a few things I have seen but they are not working. Each record is assigned a number in the table and they are part of the report. When the report is run it asks for a starting date and an ending date. Multiple records could be pulled.

Any suggestions??
Thank You!!

AMY
 

Add an additional boolean field to the table.
Default value = FALSE (not printed).
Change to TRUE after printing.


Randy
 
To add to Randy's suggestion, in your UPDATE query where you set the boolean field to TRUE, your WHERE criteria will be the same as what you used in the report.
 
How are ya quig699 . . .

[purple]Whats the point since you may have to print the report more than once?[/purple] . . . [blue]maybe the printer screws-up and you have to print again![/blue]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
I have to admit that the suggestions so far are a bit beyond me. I think there are some aspects that are assumed I know already. If there could be any more in depth suggestions I would appreciate it. It also might get my boss off my back.

Thank You
AMY
 
Amy, here's what you want to do:

1) Add the new field to your table, as Randy700 suggested.
2) Create an UPDATE type query, with the SAME CRITERIA in it so far as the dates that are selected, and add the new field to the query grid. Set the 'Update to" cell for this field to "TRUE" (or YES, if you prefer).
3) Right after the report is run, run this query as well..your code might look something like this:

Code:
DoCmd.OpenReport "MyReport", acNormal
DoCmd.OpenQuery "MyUpdateQuery"

That's all there is to it. If you are still puzzled, let us know.

Jim



--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
 
Is there any way to do it so the user doesn't have to do anything but run the report? My boss wants this as user friendly as possible.
 

Does your user run the report by clicking a comand button? Put the code suggested by WildHare on the button. The user will not have to do anything other than click the button.

If you want the screen to update and display a check in the check box, add Me.Refresh to the code, after the OpenQuery command.

Randy
 
Yes, certainly. How is your report printed now?

The simplest way is to add a command button on your form, using the Command Button Wizard to PRINT A REPORT. Follow the prompts for this wizard, and the necessary code will be attached to the button on your form.

When it's finished, right-click the button and select BUILD EVENT. This will open the VBA editing window, and place you in the code that the wizard just inserted. Immediately after the line that reads

DoCmd.OpenReport .....

add this line:

DoCmd.OpenQuery {your-update query name here }

for example,

Docmd.OpenQuery "qMarkRecordsThatPrinted"

Simple as that.





--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
 
Thank You Everyone Who helped!!!!!!!!

IT WORKS!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top