Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009
    Posts
    61

    Unanswered: Print with Focus

    Hi There,

    I am developing a databse for soem customs documentation. I have a relationship set up with others tables for the field "Delivery." By this number I need to print three copies of the following documents:

    Commercial Invoice
    NAFTA
    FCC

    I have a report created for each of these documents. I would like to use a button to print three copies of each. I am taking the code from the old database that we were using (we are integrating a bunch of old separate databases into one), but now it will only print the report for the first row on the table. Can somebody take a look at the code and tell me why it will not work?

    Private Sub Command44_Click()
    On Error GoTo Err_Command44_Click

    Dim stDocName As String

    DoCmd.OpenReport "Comercial Invoice", acNormal
    DoCmd.OpenReport "nafta", acNormal
    DoCmd.OpenReport "fcc", acNormal
    DoCmd.OpenReport "Comercial Invoice", acNormal
    DoCmd.OpenReport "nafta", acNormal
    DoCmd.OpenReport "fcc", acNormal
    DoCmd.OpenReport "Comercial Invoice", acNormal
    DoCmd.OpenReport "nafta", acNormal
    DoCmd.OpenReport "fcc", acNormal

    Exit_Command44_Click:
    Exit Sub

    Err_Command44_Click:
    MsgBox Err.Description
    Resume Exit_Command44_Click

    End Sub

    Thanks

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    "but now it will only print the report for the first row on the table", it could be many, many things and we'd need more info. Open the recordsource query of the report and perhaps check to see how many records are being returned in the query itself. It could be something as simple as grouping/sorting within the report design or something more involved such as criteria in the recordsource query which is limiting it to just 1 record.
    Last edited by pkstormy; 05-03-10 at 20:25.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Aug 2009
    Posts
    61
    Thanks, you were right. I needed to add in the criteria [Forms]![CustomsOrderDetailsEntry]![Delivery] for it to run.

Posting Permissions

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