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

Need Blank Lines in Report

P: 6
I have attached my MS Access File. After data entered in Job Card (including Invoice Tab) and When Print Invoice Button is created it prints the invoice. BUT I NEED MINIMUM 10 LINE ITEMS IN THE INVOICE DETAIL. Suppose there are 2 line items with data balance 8 can be blank lines, if 9 line are with data balance 1 blank line and if there are 15 line items all 15 with out any blank line should be there in the invoice print out. I tried all the way. But nothing succeeded. I am very bad in VB Codes.

Someone please help me with this. I have uploaded my file.
Attached Files
File Type: zip Invoce Software.zip (262.5 KB, 39 views)
Apr 14 '14 #1
Share this Question
Share on Google+
8 Replies


Rabbit
Expert Mod 10K+
P: 12,430
Sorry, but as a rule of thumb, I do not download attachments from strangers.

You don't need any VBA code. What you can do is create a table with 10 blank rows and use a union all query to append the number of rows you need.
Apr 14 '14 #2

P: 6
Thank you Rabbit for your reply.... There is a small change in my concept. After reading your reply only I realized, if there are more than 10 line data in the invoice, it would display only 10 line items and the invoice will be incomplete.
Kindly help.
Apr 15 '14 #3

zmbd
Expert Mod 5K+
P: 5,397
in which case you'll want to review the following thread:
http://bytes.com/topic/access/answer...-empty-records
We're still using a union query in this thread, we're simply appending a enough blank records to fill out the report detail, in the above thread, 15 total, for your's 10 total.

If you need more help understanding the above thread's contents, please start a new thread with reference back to this thread and/or the thread above.
Apr 15 '14 #4

P: 6
Thank you Zmbd.... But it will restrict the line to 10 irrespective of number of data, right? Suppose there are 13 data in the record, it will record only the first 10 records and will omit the balance 3 data lines. Hence the report will be incomplete. What to do if I need minimum 10 lines and if there are 13 lines in data, then I need all 13 in the report.
Please help.
Apr 26 '14 #5

zmbd
Expert Mod 5K+
P: 5,397
Why don't you actully run the query and the report as the link has shown for the union query; doing so will answer your question. (^_^)
Apr 26 '14 #6

P: 6
I tried it yesterday,.... created a blank table same as my primary table then created a query like below;

Expand|Select|Wrap|Line Numbers
  1. SELECT Null AS [IDField]
  2.      , *
  3. FROM   [tblEvidence]
  4. UNION ALL
  5. SELECT [IDField]
  6.      , Null
  7.      , Null
  8.      , ... etc
  9. FROM   [tblBlank]
  10. WHERE  ([IDField] Between ((((SELECT Count(*)
  11.                              FROM   [tblEvidence]) - 1) Mod 15) + 2) And 15)
  12.  
It gave some error message due to the word "etc".

Then I tried the other code;

Expand|Select|Wrap|Line Numbers
  1. SELECT Null AS [IDField]
  2.    , *
  3. FROM [tblEvidence]
  4.    UNION ALL
  5. SELECT [IDField]
  6. FROM   [tblBlank]
  7. WHERE  ([IDField]
  8.    Between ((((
  9.       SELECT Count(*)
  10.       FROM   [tblEvidence]) - 1) Mod 15) + 2)
  11.     And 15)
Then it returned an error, column in both tables are not same... but i had given the same column like my primary table....

Above all I am just a beginner in MS Access and just copy paste VBA Codes without any idea :)

Help would be highly appreciated.
Apr 27 '14 #7

zmbd
Expert Mod 5K+
P: 5,397
Above all I am just a beginner in MS Access and just copy paste VBA Codes without any idea :)
And that is a problem

- If you understood what you were doing, you would have realized that "etc..." isn't a valid SQL construct.

- If you had actually read the thread that I linked you to, you would have seen in both in NeoPa and my own post how to handle the column issue. You would also understand how your second SQL script is malformed.

I can understand that it can be frustrating to have people tell you that you need to learn something instead of just coughing up the answers; however, that does you no good and and makes us nothing more than unpaid programmers.

What I am going to send you via PM is a listing of tutorials and reference links. You must have a mastery of the first tutorial in order to have the basic knowledge base needed to get Access to do anything useful - and without this mastery, the more advanced concepts as you have asked for here will never make sense to you.

Check your Bytes.com Inbox in about 5 minutes from this posting time.
Apr 27 '14 #8

P: 6
Thank you so much Zmbd.
Apr 27 '14 #9

Post your reply

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