Dave Eliot said:
I have a simple contact table and input form.
Can someone point me in the direction of finding code that will allow me
to click on a button and print a standard #10 envelope for the person
displayed on the current form?
I do this all the time.
The trick here is to simply build a report that will print the envelope out.
So, simply design your report, and you usually have to place the report in
landscape mode. Most printers won't take the envelope up straight across.
Hopefully your printer has an envelope feeder. If you're planning to print
out the return address, then simply include a text label in the upper left
of the report and type in your address (that won't change for each time you
print).
For your address, simply place the fields somewhat in the center of the
report.
The next part of a little bit of trial and error, and you'll simply have to
start out usually with using full size blank sheets of paper. You jus have
to spend some time moving things around until things line up correctly...
The code behind the button to print the one record, in this case the report
is:
me.refresh
docmd.OpenReport "name of your envelope Report",,,"id = " & me!id
The above assumes that you have a primary key of "ID" in your table. If not,
just change "id" in the above to whatever you use for your primary key field
name.
Also, do try setting the page layout for an envelope. For some printers, you
may have to go into the page setup. Simply open up the report in design
mode, then go file --> page setup. You can the usually select an envelop
setting for the paper size. You can also "set" the report to a non default
printer and this works well if you have two printers, and one's always
loaded with envelopes, and thus you not have to change your default printer
to simply print out an envelope.