Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    16

    Red face Unanswered: print last records

    --------------------------------------------------------------------------------

    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 please

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: print last records

    Originally posted by biskra
    --------------------------------------------------------------------------------

    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 please
    You can make a table containing all the names of your reports, field called printed and another called PrintDate
    When the user prints a report through a button you made, update the printed to 1 for that report. and update PrintDate to Now()

    Using these two fileds printed and PrintDate you will be able to query the printed reports

  3. #3
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100

    Re: print last records

    Yes, or you can add a field in the table. This field would be a boolean called, for example, "printed". Then you print only the records with the field printed to false. When you print a record you change printed to true.

    Hope it will help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •