By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

How to control printing in ms access form

P: 23
I have a MS ACCESS Form that was designed for printing a Departmental Store’s bills. In this form I have a 6 column list box and some labels. The user adds items to this list box as per customer’s purchasing and then prints out this bill in 6x6 size paper. Command I use for printing is:-
Expand|Select|Wrap|Line Numbers
  1.  stDocName = "Print_Bill"
  2.     Set MyForm = Screen.ActiveForm
  3.     DoCmd.SelectObject acForm, stDocName, True
  4.     DoCmd.PrintOut
  5.     DoCmd.SelectObject acForm, MyForm.Name, False
Its working fine but my problem starts when the user adds more then 20 items in list box and print out the bill. Suppose the user adds 30 items in listbox and prints it out, on paper it prints only the first 20 items. Now I want that if items are more then 20 then ACCESS continues printing to the next page. I mean print a long bill in two or three pages as per items. Thanks in advance.
May 8 '10 #1
Share this Question
Share on Google+
4 Replies


Jim Doherty
Expert 100+
P: 897
@SandeepJagdeva
I am not at all surprised that this does not work very well. The design strategy is not taking into consideration the expandability of the listbox.
How are these items being added to the list?
Is the listbox RowSourcetype property a table or is a value list?

The aim should be to create a report based on the source for the list and print the report.
May 8 '10 #2

P: 23
Thanx for reply
The 'Row Source Type' property is 'Value List'. I also have a combo box in this form this comb box's 'Row Source' is a table, in which we store all product's details with their 'Bar Code'. User scan 'Bar Code' of product with 'Bar Code Scaner'. In combo's Update event I load detail (with VBA), of product such as (Name,Price) etc. That how list box filled. Reports may be good option but for me my problem is still there, because Reports also show all listbox item in single page. ????
May 8 '10 #3

Jim Doherty
Expert 100+
P: 897
@SandeepJagdeva
Yes any listbox would not automatically expand in a report. but in a Value list each item is separated by a semi colon.

If you think about it, a compact version of this could be sent to a textbox on any report replacing the semi colon with a control line feed Vbcrlf or VbNewline constant in code thus providing a conventional list. The textbox would expand to accommodate the growth. It depends largely on how nice and compact you want to be on the report.

Would it not be just as easy for you however to simply create a simple table to service the listbox and fill it with values? any report could reference a query that in turn references the table
May 8 '10 #4

P: 23
OK I try as u say. i tell u later. Hope it works
Thanx
May 8 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.