Results 1 to 11 of 11
  1. #1
    SilverFox's Avatar
    SilverFox is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2022
    Posts
    4

    Page numbers not synching up with Record numbers when printing

    I have created a form titled WORK ORDERS and this uses a Job No set as an autonumber and is the primary key. I have created a report to print records form the form so that they can be handed to employees to do the required task.



    The problem I have is when adding new forms and going to print them in the report. I have created a print report button that takes me straight to the report and its set to open in print preview to make it easier for the user. When they select the page number they want to print it ends up printing a completely different record from the Work Orders. Every time I have deleted the record and redone the autonumber it still jumps out of synch with the page number on the report and its frustrating the hell out me!

    Why is this doing this and how do I rectify it and to ensure it doesn't do it again? I have no experience with VBA at all as that stuff confuses the hell out of me!

    Any help would be greatly appreciated.

    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Can you post a copy of the db
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    SilverFox's Avatar
    SilverFox is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2022
    Posts
    4
    Quote Originally Posted by Bob Fitz View Post
    Can you post a copy of the db
    Click image for larger version. 

Name:	database1.jpg 
Views:	13 
Size:	152.5 KB 
ID:	47140Click image for larger version. 

Name:	database2.jpg 
Views:	13 
Size:	62.5 KB 
ID:	47141Click image for larger version. 

Name:	database3.jpg 
Views:	13 
Size:	134.9 KB 
ID:	47142

    Are the images satisfactory? This is the issue I am faced with

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,418
    Don't think that is what Bob meant by a 'copy of the db'. But I can say that you should not rely on autonumbers to mean anything other than a unique identifier to a record. Certainly you cannot link an autonumber and a page number

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Ajax is quite right. When I said a copy of the db, I meant exactly what I said. "A copy of the DB". At least the pictures help a little in understanding your problem.
    You could restrict the output of data to the report, so that only the required record is in the report. Then the user need not worry about what page to print.
    That what I would do.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    As others suggested use the Where clause of the Docmd.OpenReport method to specify the current JobNo loaded in the form (the one you want to print):
    https://docs.microsoft.com/en-us/off...cmd.openreport
    Post back your code (enclosed in the # code tags) if you get stuck.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    SilverFox's Avatar
    SilverFox is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2022
    Posts
    4
    I have tried attaching the database but it will not upload which is frustrating

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    You need to run a compact and repair to shrink its size than zip it.
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  9. #9
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by SilverFox View Post
    I have tried attaching the database but it will not upload which is frustrating
    There is a button you can press at the very top of each thread with the words "How to Attach Files" which will give you detailed instructions.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  10. #10
    SilverFox's Avatar
    SilverFox is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2022
    Posts
    4
    Thank you all for your help I have stumbled onto another method of printing each form by creating a button on the form and selecting preview report. I can now open a report just for that record and print if off This does away with the reports all being opened at once and trying to link autonumber to page number.

  11. #11
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    That sounds like an excellent solution. Glad we were able to help you.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 09-29-2020, 10:16 AM
  2. Replies: 1
    Last Post: 07-10-2017, 10:07 AM
  3. Replies: 3
    Last Post: 05-11-2015, 12:35 PM
  4. Replies: 8
    Last Post: 03-10-2014, 11:47 AM
  5. Replies: 1
    Last Post: 11-29-2011, 08:43 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