Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Jun 2009
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table Append Post Report

    I'm looking for an efficient way to write a new record to a log table once a report is run. For example, I have a report that can be printed out for a customer with their account balance. Once a report is generated, I'd like to write a record to the log table with the following info:

    date/time
    customer
    letter name (report)

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    You could add an Event Procedure to the OnLoad event for the Report and add code to insert the record in the table.

  3. #3
    Star Lounger
    Join Date
    Jun 2009
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the quick reply. Do you have an example for the insert?

    Option Compare Database


    Private Sub Report_Open(Cancel As Integer)


    End Sub

  4. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    What are the table and columns names and where are the values you want to insert, especially the customer name?

  5. #5
    Star Lounger
    Join Date
    Jun 2009
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Table Name: LetterLog
    Field Names: LetterDate, LetterName, CustomerName

  6. #6
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    You failed to let me know where the customer name can be retrieved.

  7. #7
    Star Lounger
    Join Date
    Jun 2009
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I apologize, the owner name is a field on the report from my query. So basically, I have a query that asks for the customer name, and once selected from a dropdown, populates the report.

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by bkirby View Post
    I apologize, the owner name is a field on the report from my query. So basically, I have a query that asks for the customer name, and once selected from a dropdown, populates the report.
    Does the query prompt for the customer name? or do you have a combo box on a form and you select a name from that before opening the open the report with a command button?
    Regards
    John



Posting Permissions

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