Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access 2000 (Pages to print)

    I am considering the second alternative for printing pages, namely form an optionbox.Which is the shortest way to tie up the command in the option box with the command to print ? I have given in the attachement the example.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 (Pages to print)

    In the code behind your print button add:

    Dim intPagestoPrint as integer
    intPagestoPrint = Me.PageNumbers

    then
    DoCmd.PrintOut copies:=intPagestoPrint
    Regards
    John



  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 (Pages to print)

    Sorry I just noticed something else.

    For the values in the Option Group, the first three have the value equal to their Labels. For my code to work you need to change the other two so that is also true.

    So for 10 , set is Option Value to 10.

    The 20 one has been added later I think. It is not part of the group and is bound to a field.

    I suggest you recreate the whole option group, and give each a value equal to the Label Names.
    Regards
    John



  4. #4
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 (Pages to print)

    Thank you so much. It is a great idea,i tried it but i get some strange results.For example for option value 1 i get 4 copies and for option value 2 i get 8 copies.Do i have something wrong ?

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 (Pages to print)

    I can think of two things.

    Either the values of the option group elements are wrong, or the actual labels themselves are four pages long. In this case one copy will give 4 pages, two copies will gives 8 pages etc.
    Regards
    John



  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access 2000 (Pages to print)

    Are you sure that the Option Value property of the option buttons has been set correctly?

    Do you also have code in the report to control printing?

  7. #7
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 (Pages to print)

    Thank you so much for the thourough attention you are giving to any problem.I am sending you the stripped attachement to see my problem.I have set the option value correct, and i have made the report blank, just to make sure for the origin of my faulire.But again with option value 1 i print out 4 pages.May be the reson is somehere in the printer.But in my code i do not see any refernce to may option group which is called PageNumber.Maybe the reason is in this my ommission ?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access 2000 (Pages to print)

    Your report is not bound to a table or query.
    The detail section is much too large to fit on one page, so even though it contains nothing, it takes up 4 pages. You should make the detail section much smaller, by dragging its right edge to the left and its bottom edge up.

    PS your option button with option value 20 has a label that says 10. This is confusing.

  9. #9
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 (Pages to print)

    The db you posted only has a blank page as a report, but (it is 2 pages wide and 2 pages long) so when you print a copy of it you get 4 blank pages.
    When i shrnak it to one page wide and long, I got the right number of pages printed.
    Regards
    John



  10. #10
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 (Pages to print)

    Thank you very much.it is all clear to me now.

Posting Permissions

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