print only last records

biskra

Registered User.
Local time
Today, 07:46
Joined
Jan 12, 2004
Messages
36
I need the button to print any records that have not already been printed, even if this means you click on the button at 10am in the morning and then you might want to click on it at 12am the same day - the button just needs to pick up only the reports that haven't been printed before and print those.
I'm quite new to Access, so don't know how to do what you suggest anyway.
any more ideas?
thanks


i found this code

DoCmd.OpenReport "Reportname", acViewNormal, WhereCondition := "Printed=False And RecordDate=#" & Date() & "#" ' force it to print on the printer
DoCmd.SetWarnings False
DoCmd.RunSQL "Update table set printed=true where Printed=false and RecordDate=#" & Date() & "#"
DoCmd.SetWarnings True


but no solution
any help plmease
 
Hi

I have a sales order that does the same thing. What I have done is added a field in my table called printed, after it has run a query on the close of my report it updates my check box in the table.

Hope that helps

Here's my code : DoCmd.SetWarnings False

DoCmd.RunSQL "UPDATE Table SET Printed = -1 WHERE Printed = 0"
DoCmd.RunSQL "UPDATE Table SET DieNum = NewDie Where IsNull (DieNum)"
DoCmd.SetWarnings True
 
Last edited:

Users who are viewing this thread

Back
Top Bottom