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

VB6 Format(Code For Printing Cash Receipts)

Tenneyson
P: 17
Hi

Can anybody help! how do i format this code so that the results printed will be aligned. E.G. should print like this

First Funeral Assurance Co.

PolicyNo : F000001
Name : Tenneyson Katunga
Premium : $100.00


Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdtest_Click()
  2.  
  3. Printer.Print "First Funeral Assurance Company"
  4. Printer.Print "Policy No: " & txtPolicyNo.Text
  5. Printer.Print "Name: " & dgPaymentsFinal.Columns("Surname") & " " & dgPaymentsFinal.Columns("FName")
  6. Printer.Print "Premium  : " & Format(txtPremium.Text, "$0,000.00")
  7. Printer.EndDoc
  8.  
  9. End Sub
  10.  
Apr 12 '08 #1
Share this Question
Share on Google+
3 Replies


debasisdas
Expert 5K+
P: 8,127
Better try to use some reporting tool like Crystal report or data report for the purpose.
Apr 14 '08 #2

QVeen72
Expert 100+
P: 1,445
Hi,

Try this :

Expand|Select|Wrap|Line Numbers
  1. Printer.FontBold = True
  2. Printer.Print "First Funeral Assurance Company"
  3. Printer.Print "Policy No: " ;
  4. Printer.FontBold = False
  5. Printer.Print txtPolicyNo.Text
  6. Printer.FontBold = True
  7. Printer.Print "Name: ";
  8. Printer.FontBold = False
  9. Printer.Print dgPaymentsFinal.Columns("Surname") & " " & dgPaymentsFinal.Columns("FName")
  10. Printer.FontBold = True
  11. Printer.Print "Premium  : ";
  12. Printer.FontBold = False
  13. Printer.Print Format(txtPremium.Text, "$0,000.00")
  14. Printer.EndDoc
  15. Printer.NewPage
  16.  
a SemiColon at the End, ensures, you are printing some more info on the same line..

Regards
Veena
Apr 14 '08 #3

Tenneyson
P: 17
Hi,

Try this :

Expand|Select|Wrap|Line Numbers
  1. Printer.FontBold = True
  2. Printer.Print "First Funeral Assurance Company"
  3. Printer.Print "Policy No: " ;
  4. Printer.FontBold = False
  5. Printer.Print txtPolicyNo.Text
  6. Printer.FontBold = True
  7. Printer.Print "Name: ";
  8. Printer.FontBold = False
  9. Printer.Print dgPaymentsFinal.Columns("Surname") & " " & dgPaymentsFinal.Columns("FName")
  10. Printer.FontBold = True
  11. Printer.Print "Premium  : ";
  12. Printer.FontBold = False
  13. Printer.Print Format(txtPremium.Text, "$0,000.00")
  14. Printer.EndDoc
  15. Printer.NewPage
  16.  
a SemiColon at the End, ensures, you are printing some more info on the same line..

Regards
Veena
Hi Veena

thanks for your help, It seems to be working

regards
Apr 14 '08 #4

Post your reply

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