Results 1 to 14 of 14
  1. #1
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10

    How to keep form on one page

    I'm a totally beginner and I learn Access from youtube. I created some tables and a form. I created a print button for my form but when it prints, it prints on two pages because the width of the form is too wide. How do I fix it when I am on the design view (I am assuming this has something to do on the formatting).



    Also, how do I show the print preview when I click the print button? I don't know VBA at all. But, I plan to learn that after I get familiar with the basic stuffs.

    Thank you in advance.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You can adjust the width of your report. I think the default is .25 inches for margins. IIRC, there is a global setting in the main Options for Access via the BackStage (File Tab).

    Anyway You need to move all of your controls, including lines, boxes, etc. within the maximum width of the page/Report. So, if you are printing on 8.5X11 paper and your report's design surface is beyond 8'' wide, you will get a little error msg in the upper left of the report. This is because, .25+.25+8 = 8.5

    If your printer can hack it, you can resize the margins via Page Setup while in design view of the Report. So you might be able to go from .25 to .16 or something.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Forms are for viewing, Reports are for printing.
    You should not print the form.

    Create a report.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Steve has made the important point, here...Forms are for Viewing/Entering Data...Reports are for Printing!

    If you adjust your Form so it prints one a single sheet of paper, it'll probably not look right, when Viewing/Entering Data.

    Also, if your Form is so wide that it requires the user to scroll, to see all of the Controls (as it very well might, since it's wide enough to require printing on two pages) this probably needs to be addressed, too! Making the user scroll either up-and-down, or side-to-side, to see all of the Controls, is just about the absolutely most UnUser-Friendly thing a developer can do.

    Depending on your situation, perhaps using a Tabbed Control to divide your data up, logically, would be appropriate. How many Controls do you currently have on your Form?

    Linq ;0)>

  5. #5
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10
    Quote Originally Posted by Missinglinq View Post
    Steve has made the important point, here...Forms are for Viewing/Entering Data...Reports are for Printing!

    If you adjust your Form so it prints one a single sheet of paper, it'll probably not look right, when Viewing/Entering Data.

    Also, if your Form is so wide that it requires the user to scroll, to see all of the Controls (as it very well might, since it's wide enough to require printing on two pages) this probably needs to be addressed, too! Making the user scroll either up-and-down, or side-to-side, to see all of the Controls, is just about the absolutely most UnUser-Friendly thing a developer can do.

    Depending on your situation, perhaps using a Tabbed Control to divide your data up, logically, would be appropriate. How many Controls do you currently have on your Form?

    Linq ;0)>
    Hello Ling:

    Thanks for the post and suggestion. On my form, it has only one control, the "Print" button. I think I should rephrase my question to Can I print the record through form view. Do you know how sometimes when you place an order online and after you have filled out all the information there is a button for you to print whatever you fill out?

    The form I have is a work order form for the maintenance. It has the order number for them to keep track the time to perform a work. Whatever the supervisor to fill out on the form, I need to print one copy for the maintenance.

  6. #6
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10
    Quote Originally Posted by ItsMe View Post
    You can adjust the width of your report. I think the default is .25 inches for margins. IIRC, there is a global setting in the main Options for Access via the BackStage (File Tab).

    Anyway You need to move all of your controls, including lines, boxes, etc. within the maximum width of the page/Report. So, if you are printing on 8.5X11 paper and your report's design surface is beyond 8'' wide, you will get a little error msg in the upper left of the report. This is because, .25+.25+8 = 8.5

    If your printer can hack it, you can resize the margins via Page Setup while in design view of the Report. So you might be able to go from .25 to .16 or something.
    ItsMe:
    Thanks for the suggestions...I did see the setup under the Access Option. But, I don't know why it didn't show the print preview before I click the print button.

  7. #7
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10
    Hi Steve,

    Thank you! I think what I what to do is to print the record through the form view. Hhhmmm...I need to do more reading on this part!

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    If you want to print your form, you will have to move all of your controls into an area smaller than the page size. And then you will have to adjust the Width of the form, too.

    As pointed out by others, I totally missed the point that you are trying to print a form. I was stuck on the idea you were having trouble printing a report. It may be best to create a report. You can use your form to tell the Report what record(s) to open via VBA code.

  9. #9
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10
    Quote Originally Posted by ItsMe View Post
    If you want to print your form, you will have to move all of your controls into an area smaller than the page size. And then you will have to adjust the Width of the form, too.

    As pointed out by others, I totally missed the point that you are trying to print a form. I was stuck on the idea you were having trouble printing a report. It may be best to create a report. You can use your form to tell the Report what record(s) to open via VBA code.
    Hi There,

    I just tried this code that I found online and it works but the problem is it is included all the records. All I need is to print one record only.
    This is what I have:

    Private Sub cmd_PrintCurrentOrder_Click()

    If Me.Dirty Then
    Me.Dirty = False
    End If

    If Me.NewRecord Then
    MsgBox "Select a record to print", vbExclamation, "Print Order"
    Else
    Str_Where = "[Work Order Number] = " & Me.Order_ID
    DoCmd.OpenReport "Order", acViewPreview, , str_Where
    End If

    End Sub

    When the print preview shows my work order, the number of page shows "1 of 3"...I have three records.

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You need to take a close look at this code "[Work Order Number] = " & Me.Order_ID

    Is Work Order Number related to Order ID? Try adding a message box to your code so you can see what is going on with your criteria that you are sending to your Report's Filter property.
    Code:
    ...
    Str_Where = "[Work Order Number] = " & Me.Order_ID
    msgbox Str_Where
    DoCmd.OpenReport "Order", acViewPreview, , str_Where
    ...

  11. #11
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10
    Quote Originally Posted by ItsMe View Post
    You need to take a close look at this code "[Work Order Number] = " & Me.Order_ID

    Is Work Order Number related to Order ID? Try adding a message box to your code so you can see what is going on with your criteria that you are sending to your Report's Filter property.
    Code:
    ...
    Str_Where = "[Work Order Number] = " & Me.Order_ID
    msgbox Str_Where
    DoCmd.OpenReport "Order", acViewPreview, , str_Where
    ...
    Yes...Actually, the code I have is .... = " & Me.Order_Order_Number

  12. #12
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Did you try adding a msgbox like I suggested? This will help to determine what is being applied to the Report's filter property, if anything.

  13. #13
    YYP is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    10
    Quote Originally Posted by ItsMe View Post
    Did you try adding a msgbox like I suggested? This will help to determine what is being applied to the Report's filter property, if anything.
    Yes, I did. When there is an unfilled record, the msg will pop up.

  14. #14
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by YYP View Post
    Yes, I did. When there is an unfilled record, the msg will pop up.
    And when you compare the message to the records in the report, the report makes sense and all is good?

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

Similar Threads

  1. Replies: 3
    Last Post: 05-11-2015, 12:35 PM
  2. Replies: 10
    Last Post: 06-19-2014, 01:51 AM
  3. Replies: 1
    Last Post: 03-05-2013, 06:38 PM
  4. Replies: 4
    Last Post: 06-30-2011, 08:39 PM
  5. Page break on report inserts empty page between
    By Galadrielle in forum Reports
    Replies: 0
    Last Post: 07-07-2010, 04:18 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