Or if you want to print it out in a different way to how the form looks then something like this:
VB Code:
Private Sub cmdPrint_Click() intResponse = MsgBox("Are you sure you want to print?", 4 + vbQuestion, "Print") 'Message box appears asking if you are sure you want to print If (intResponse = 6) Then 'If the answer is Yes then Printer.FontSize = 20 'Font size is 20 Printer.FontUnderline = True 'Font is underlined Printer.Font = "Arial" 'Font is Arial Printer.Print 'Prints a blank line Printer.Print Tab(1); "Customer Details" 'Prints Customer Details Printer.FontSize = 14 'Font size is 14 Printer.FontUnderline = False 'Font is not underlined Printer.Print 'Prints blank line Printer.Print Tab(10); lblName.Caption '10 spaces and prints the caption of the Name label Printer.Print Tab(10); lblAddress1.Caption '10 spaces and prints the caption of the 1st address line Printer.Print Tab(10); lblAddress2.Caption '10 spaces and prints the caption of the 2nd address line Printer.Print Tab(10); lblPostcode.Caption '10 spaces and prints the postcode Printer.Print Tab(10); lblPhone.Caption '10 spaces and prints the phone number Reference = lblName.Caption 'The variable 'Reference' is lblname.Caption Reference2 = lblPostcode.Caption 'The variable 'Reference2' is lblPostcode.caption Reference3 = lblPhone.Caption 'The variable, 'Reference3' is lblPhone.Caption Printer.Print 'Prints a blank line Printer.EndDoc 'Ends printing End If 'Ends If Function End Sub
You get the idea...




Reply With Quote