Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    May 2002
    Location
    Wytheville,VA, Virginia, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PrintWhen like in FoxPro (97SR2)

    Does A97 have any functions similar to the FoxPro option of "Print When" for reports? I need to print a total for a certain part number AFTER the others have been calculated. For example, I have 10 parts with their own part number and a total for each. If they are numbered 1-10, how do I print all but #5 in the detail section, then at the report footer, put a total for #'s 1-4 and 6-10, then display # 5, then subtract the total for #5 from the grand total?

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: PrintWhen like in FoxPro (97SR2)

    Is sounds as if a parameter query on the recordset for the report may work. You need to tell the report which data to exclude. You can then manipulate the report totals as needed.
    Regards,

    Gary
    (It's been a while!)

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: PrintWhen like in FoxPro (97SR2)

    It sounds like you need the sorting and grouping features of Access reports.

    Since it isn't obvious why you would skip part #5 in one place and print it somewhere else, I suspect that there is another piece of information that determines how the parts group together. If you create grouping on that other piece of information, the details will print for each group and you can put your totals into the group footer. Then you can put a grand total calculation into the report footer.

    If you don't have the sample reports database for Access 97, I'd suggest you download it here. That will help you get up to speed on some of the fancy things you can do with Access reports.
    Charlotte

  4. #4
    Lounger
    Join Date
    May 2002
    Location
    Wytheville,VA, Virginia, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PrintWhen like in FoxPro (97SR2)

    This is an inventory report. . Part #5 is like a generic part number for "in transit" or "in production" parts (I didn't design nor do I have any control over the numbering scheme). The reason for leaving it out initially is to get a total "on-hand". Then #5's total is added to the on-hand total to get a grand total. I'll play around with the grouping option, but I'm not sure exactly how it works. In the mean time, I created a separate query that only totals part #5. I then created a new form that has a text box that displays that total. From there, I changed the report's control source to exclude #5 and added a text box to the footer that displays the #5 total from the form and then adds it to the total for all the others. Kind of a crude work around but it works. Now I can concentrate more on your suggestions to help automate the process.

    Thanks for the link to the report sample db. I had it once before and lost it. Were it not for the "Solutions", "QrySample", and "ReportSample" db's I wouldn't be anywhere close to where I am now in my knowledge of Access.

  5. #5
    Lounger
    Join Date
    May 2002
    Location
    Wytheville,VA, Virginia, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PrintWhen like in FoxPro (97SR2)

    Ok, problem solved. I ended up just putting another field in the query to test if the part number was #5.

    test5: iif([part_num]<> "#5",1,2)

    then I just grouped on the test5 field on the report and hid the field. I made a total field in the group footer, but since I only wanted to see the total for #5 once, I hid the footer if the detail was for #5 i.e.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If test5 = 2 Then
    Reports!myreport.Section(6).Visible = False
    Else
    Reports!myreport.Section(6).Visible = True
    End If
    End Sub

    From there I just put a "Grand Total" field in the report footer and voila!
    Thanks for the ideas. They were just the spark I needed to get back on track. I had forgotten that the user doesn't need to see everything that's going on...just the final product.

Posting Permissions

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