Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    justinwright is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    104
    Is the detail section the correct placement for it?



    Is that the correct code, or should I use text boxes with .Value?

    I'm not sure why it isn't changing, but like I said it loads the first record's info on the report just fine. It prints the correct number of filtered items as well. The only problem is the number of printouts, instead of having the info for each entry, all have the info for the first entry on it.

    Thanks for the help so far!

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The detail section is where I would expect it to work. .Value is the default, so your code looks fine from that regard too. Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    justinwright is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    104
    I attached a sample, sorry if I'm not more clear on the issue, but I thank you for bearing with me as usual anyways!

    It was too large for forum (1.09 MB) so I posted it here:

    http://www.mediafire.com/?8ndkeos473hh1zs

    Let me know if that's a problem, or where you'd prefer me host it.

    Right now the relevant button is on frmPrint on the letter side of things (the rest will come later as I work this one out, since it's basically just copy + paste at that point). It prints the No Surcharge report, based off the query of similar name.

    EDIT:

    I also noticed that I was incorrect about one of the problems.

    Lets say there are 5 filtered entries. It will print 25 times. If there are 4 entries, it will print 16 times. So it seems like it's printing the number of entries total for each number. So, 1 entry will only print once.

    But the same problem above still remains. All of the printouts have the information of the first entry on all of them.

    I also saw something similar (general question wise) here:

    https://www.accessforums.net/reports...ble-10023.html

    I also found this:
    You might need to
    put a page break in the footer for your groupings, though,
    to make sure you get the correct data in the headers.
    Could this be my problem as well? I'm working on testing it now, but I'm not sure if I'm going about it correctly.

    This also seems kinda related:

    http://www.access-programmers.co.uk/...d.php?t=100061

    But I'm not sure how that relates to how I want to print each entry's information on it.

    EDIT2:

    I tested putting the pagebreak into the page footer, as well as the report detail section (at the bottom of it) to no avail.

  4. #19
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Will the db not attach here if you compact/repair and then zip? Mediafire doesn't want to let me in, probably because I don't allow cookies from most sites. You can email it if not:

    email deleted

    I've never needed to insert a page break to get data to come out right, only to get it to break in a specific place.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #20
    justinwright is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    104
    Oh oops, forgot to compact >_<

    Trying again, exactly the limit it seems

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The "no surcharge" query/report currently return no records. I created a couple and I see the behavior you're seeing. Something is haywire with that report. I made a new one with the wizard and put a page break in the detail section to force each record to a new page and it seemed to work. I didn't bother with code, just used textboxes with control sources like

    =[AgentStoreOrChain] & " (Agent # " & [AgentNum] & ")"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    justinwright is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    104
    Sorry about that, I kinda stripped the DB data since I was posting it publicly here.

    Do you mind attaching the DB so I can get a better idea?

    EDIT:

    Oh wow. As I typed that, it hit me. I have the fields in the "Report Footer," and I read from that to show the desired entries. Would that be my problem (since the footer for the entire report has nothing to do with per page)?

    EDIT2:

    That was it! Well, at least for the problem in the information not changing. I put the fields in the "Page Footer" instead of the "Report Footer" (neither are visible when printed). The only problem left is the number of items printed (ie 5 items will each be printed 5 times each, as 5 seperate jobs when only the 1st job is all that's needed). The only conclusion that I've come to is that it has something to do with that loop in the button code on frmPrint. Do you mind taking a look at it and seeing if I put that in the incorrect place or something?

    The only other thing that I could think of is forcing a pagebreak at the bottom of the detail section and not looping at all, but again I wouldn't know how to do that, so if possible I'd like to use the code that was heavily based off of the link you pointed me to right off; perhaps I just have the Do.Cmd OpenReport in the wrong part of the loop (causing it to loop that command that number of times as well maybe?).

  8. #23
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    DUH! How stupid am I, never scrolling down and seeing that.

    The code I gave you is designed to be used with a report that filtered itself based on the current record in the recordset loop. Because you're not filtering the report to a specific owner, you get the repetitive copies.

    If you're just going to print them all, and you've got it set up to print one per page, you probably don't need that code at all. It's more appropriate for when you want to email each customer their own data or something like that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #24
    justinwright is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    104
    Okay... so this is going to be a dumb question, but how do I do that?

    I'm not sure how to print one per page (I assume that it has to do with the force new page property in the the Detail section). How would I go about doing that with the current setup I have? How would that work? I assume it worked correctly (with the info in the footer and reading that to set the captions) with the loop only because it was doing one at a time... would it still work processing multiple items all at once? Hopefully that question makes sense.

    Just for clarification, that is exactly what I want. Having 100+ entries in the table, then having the report printed for every entry at once (with their information on it as needed), with each record being one full page (letter).


    EDIT:

    Nevermind, I got it! For anyone that reads this in the future, I just left off the where filter for the OpenReport

    Thanks a lot! You are a life saver pbaldy!

  10. #25
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. export multiple reports based on table records
    By steve2000 in forum Reports
    Replies: 3
    Last Post: 10-03-2010, 03:44 PM
  2. Printing multiple reports with one command
    By AKQTS in forum Reports
    Replies: 2
    Last Post: 09-24-2010, 09:32 AM
  3. Replies: 1
    Last Post: 07-02-2010, 03:55 AM
  4. Update 2 fields based on where condition.
    By Confused in forum Access
    Replies: 2
    Last Post: 11-19-2009, 05:21 PM
  5. Highlighting Report Data Based on a Condition
    By KramerJ in forum Reports
    Replies: 1
    Last Post: 05-29-2009, 10:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums