Results 1 to 2 of 2
  1. #1
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86

    Report that one box that print numbers between these two numbers

    I have a query made already with all the information I need on it but I am unsure how to make the SKID# box print out like the excel code. Excel code is below and in excel it prints out the numbers starting from the first input and ending at the last input. What the sheet looks like is also attached. I want to make a report that looks like the excel sheet and prints out just like the excel sheet with the operator putting in the starting and ending number for the skid.



    Thank you for the help.

    Click image for larger version. 

Name:	excel skid.PNG 
Views:	6 
Size:	23.0 KB 
ID:	27914

    Private Sub CommandButton1_Click()
    Dim copies As Integer
    Dim MyInput As Integer
    Dim StartInput As Integer


    StartInput = InputBox("Starting Number?")
    MyInput = InputBox("Ending Number?")


    For copies = StartInput To MyInput
    Cells(5, 10).Select 'this will be where you want to form number to appear


    ActiveCell.Value = copies 'this assumes you want to start with #1. You can
    'change this to ActiveCell.Value = ActiveCell.Value + 1


    'and manually set the first
    'form number before you run the macro


    ActiveWindow.SelectedSheets.PrintOut copies:=1, Collate:=True
    Next copies


    End Sub

  2. #2
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86
    OK so I did not think I could figure it out but I just did. Code below.

    Dim copies As Integer
    Dim MyInput As Integer
    Dim StartInput As Integer


    StartInput = InputBox("Starting Number?")
    MyInput = InputBox("Ending Number?")


    For copies = StartInput To MyInput
    'this will be where you want to form number to appear


    Me.SKID_NUMBER.Value = copies 'this assumes you want to start with #1. You can
    'change this to ActiveCell.Value = ActiveCell.Value + 1


    'and manually set the first
    'form number before you run the macro




    DoCmd.PrintOut
    Next copies

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

Similar Threads

  1. Replies: 8
    Last Post: 03-10-2014, 11:47 AM
  2. same numbers = differnet numbers?
    By mike02 in forum Queries
    Replies: 1
    Last Post: 07-17-2013, 03:40 PM
  3. Sorting numbers on a report
    By paul123 in forum Access
    Replies: 6
    Last Post: 02-15-2012, 03:34 PM
  4. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  5. Formatting numbers in a report
    By bullwinkle55423 in forum Reports
    Replies: 1
    Last Post: 11-09-2010, 01:12 PM

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