Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One more label question

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
My database contains a customer table with name and address fields, etc. How can I (or what is the best way) to allow users to print a mailing label for a single customer?

My thought is to create a form that allows users to search for customers by their last name. Then once the fields on the form are populated with the customer's name and address information, use it to print the appropriate label report.

The trouble I'm having is how the customer data from the form becomes the data used by the label/report. IOW, how does the report know that's the record to be printed on the label?

I looked in Northwind for an example but the customer report in there prints all of them. I want the users to be able to print individual labels for a customer of their choosing.

Does anyone know of code that already exists for this?


Thanks in advance,
KerryL
 
KerryL,

Try this code to open the report and transfer over values:

DoCmd.OpenReport "ReportName", acViewPreview, , "[Name] = Forms![LabelMaker]![Name] and [Address] = Forms![LableMaker]![Address]"

The acViewPreview is to preview the label before you print it. If you just want it to print, I think you can just delete this portion of the code out (but leave the ",").

If you need mover help, please ask.

Marrow

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top