How to mark a report as a already printed report ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • patekos
    New Member
    • Mar 2011
    • 3

    How to mark a report as a already printed report ?

    Hi all,

    I have a report based on a table and i want something that could flag it when it is printed so i can not print it again ?

    thanks in advave
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    I would have a field in the table that I set manually (or by manually running code to set it)

    The problem with automating a task like this is basicly the printer, since alot of things can go wrong, such as paperjam, or network errors....

    That said, you can still have a field in your table that get sets automatically when you print.

    Comment

    • patekos
      New Member
      • Mar 2011
      • 3

      #3
      Hi SmileyCoder,
      thanks for your rapid answer. I understand that there are some problems that could happen in automating the process ... but could you give me some orientation how can I update a field in a table when i print the report ???
      Thank you

      Comment

      • TheSmileyCoder
        Recognized Expert Moderator Top Contributor
        • Dec 2009
        • 2322

        #4
        This would be a simple way of doing it, for simple reports. For more adv. reports you may need to add to the code.

        Code:
        Private Sub Report_Open(Cancel As Integer)
            Dim strSQL As String
            strSQL = Me.RecordSource
            Dim rsDAO As DAO.Recordset
            Set rsDAO = CurrentDb.OpenRecordset(strSQL)
            
            Do While Not rsDAO.EOF
                
                rsDAO.Edit
                rsDAO!bPrinted = True
                rsDAO.Update
                rsDAO.MoveNext
            Loop
            
            Set rsDAO = Nothing
        End Sub

        Comment

        • patekos
          New Member
          • Mar 2011
          • 3

          #5
          It Works find for me.
          Thanks for your great help ...

          Comment

          Working...