• Access 2000 (Pages to print)

    Author
    Topic
    #435972

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1032184

      In the code behind your print button add:

      Dim intPagestoPrint as integer
      intPagestoPrint = Me.PageNumbers

      then
      DoCmd.PrintOut copies:=intPagestoPrint

    • #1032185

      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.

      • #1032188

        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 ?

        • #1032191

          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.

        • #1032192

          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?

          • #1032194

            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 ?

            • #1032195

              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.

            • #1032196

              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.

            • #1032199

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

    Viewing 1 reply thread
    Reply To: Access 2000 (Pages to print)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: