473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

VB6 Format(Code For Printing Cash Receipts)

Tenneyson
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
3 7822
debasisdas
8,127 Expert 4TB
Better try to use some reporting tool like Crystal report or data report for the purpose.
Apr 14 '08 #2
QVeen72
1,445 Expert 1GB
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
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

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

Similar topics

1
by: Helmut Jarausch | last post by:
Hi, is there a format code to return an unsigned int to Python via Py_BuildValue? Just using code 'i' gives negative values for values greater than 2**31. I've tried the code 'I' (with python...
0
by: Josiah Carlson | last post by:
Good day everyone, I have produced a patch against the latest CVS to add support for two new formatting characters in the struct module. It is currently an RFE, which I include a link to at the...
4
by: sql guy123 | last post by:
HI, I'm pretty new to MS SQL, My problem is setting .... =Format$(Date(),"mm" & "/1/" & "YYYY") (Which is from my MS ACCESS database)
5
by: kirk_korver | last post by:
Group, I'm trying to understand the problem with the following code. The problem I get is associated with the line "int fmt = format(); " at the bottom of the line. The error I get says that ...
3
by: Paul | last post by:
I use OpenOffice but I suppose similar formatting rules apply to MS Excel. For example, to format a cell for two digit numbering, the format code is: #,##0.00 I can use formulas (=F$temp + 5)...
1
by: dipalrana | last post by:
What is the format code for Nokia N72? Samsung SGH E250V?
3
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I am not sure how to change the date format in PostgreSQL. I have the dates stored in the database as yyyy-mm-dd HH:MM:SS+TimeZone to get the GMT time (Ex: 2008-02-28 14:03:23+05:30). But...
8
by: joemacbusiness | last post by:
Hi All, How do I format printed data in python? I could not find this in the Python Reference Manual: http://docs.python.org/ref/print.html Nor could I find it in Matloff's great tutorial:...
7
by: neovantage | last post by:
Hey all, I am creating a xml file in this format <?xml version="1.0" encoding="utf-8" standalone="yes"?> <customers> <customer> <category>Brosch&uuml;ren</category> ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.