create a printable invoice

channi

New member
Local time
Today, 14:57
Joined
Jul 27, 2003
Messages
5
I am a newby, trying to create an access db along the lines of a panorama db I have been using - without deeply understanding it - hoping to be able to transfer it to my new creation at some point.

I have created the basic table with the SUBSCRIBER information, and I would like to produce new invoices. For this I created a related INVOICES db, on which I would like the address of the customer to appear when I select the related customerID. It should appear on the Invoices form as information only, not for data entry.
I would like it to appear in one text field, formatted like it is printed on the envelope.

How does one do this?

If this topic has already been treated, please refer me to the relevant place.
 
Try this.

1) Create a text box on the Invoice Form. Make it about 2.5 - 3" wide and 1" high. Name it ClientInfo (or whatever you like)

2) Set the following properties for the ClientInfo Text Box

Enabled = False
Locked = True

3) Enter the following in the ControlSource Property (use your own field names)

= [CLientName] & vbcrlf & [Address1] & vbcrlf & [Address2] & vbcrlf & [City] & ", " & [State] & " " & [Zip]

That will do it.

Good luck. If you have any questions, please let me know.
 
Thanks,

I have made some progress, as I have succeeded in creating the form which lets me create invoices.
I followed your advice however with no success. "vbcrlf" caused an error message. I found no reference to this expression anywhere.
I have succeeded to sqeeze all fields of the customerdetails into one text field, and still wonder how to order it, with line breaks.
Did I miss anything?

By the way, I have about a million questions.
 
well, more of the same question:

I have now the form, but how do I get a printout? I would like to be able to use my letterhead.

Could I do a merge in MSWord? The problem here is that my form is based on two tables, and I can only relate one table to the msword document for merging.

Equally, a report needs to be related to either a table or a query. How can I get what appears on my form onto paper in the appropriate way?
 
vbCrLf is a VBA constant for Carriage Return Line Feed and should be available on your system. If not replace it with Chr$(13) & Chr$(10). These are the ASCII Codes for a Carriage Return Line Feed.
 
to print, enter the following code:


Private Sub your_button_name_Click()
On Error GoTo Err_your_button_name_Click

If MsgBox("Are you sure you want to print the Invoice?", vbExclamation + vbYesNo, "Print Invoice?") = vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Else
MsgBox "Print cancelled.", vbInformation
DoCmd.CancelEvent

End If


Exit_your_button_name_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_your_button_name_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom