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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting records for printing labels

Status
Not open for further replies.

chiefl

Technical User
May 19, 2002
37
US
I am using Contact Template that you can download in access by going New --> Contacts. I have one problem. I want to print mailing labels to a select group of people in the database. I Select the column that contains the data I want to filter and set the filter to select just the records I want to use for the labels. The filtering removes all but the records I want to use for printing the labels. I then go through the print labels and when I do a print review all of the records in the database appear on labels. How do I tell the label printing process all I want are the filtered records?
Any ideas/guidance would be appreciated.
 
I assume you are hoping to apply the current filter from your form to your report. This might be possible by taking the form's filter property and using it in the where condition of the DoCmd.OpenReport method.

Does your "go through the print labels" use any code? If so, could you share the code?

Modifying your code to something like the following might work. This would depend on the fields used in the filtering and the fields in the report's record source.
Code:
  dim strWhere as String
  If Me.FilterOn = True Then
    strWhere = Me.Filter
  End If
  DoCmd.OpenReport "rptYourLabels", acPreview, , strWhere

Duane
Hook'D on Access
MS Access MVP
 
I am sorry for not mentioning in my original post, I have no experience with databases. I am using the template I downloaded and it has a print labels function.
Your comment about hoping to apply the current filter from your form to your report leads me to think the normal way to filter is to filter the report. Is that correct?
 
If I want to filter a report, I will generally provide some user interface that allows selecting records or entering criteria. I use this information to limit the records displayed in the report.

Duane
Hook'D on Access
MS Access MVP
 
I found the fix. I applied the sort while in the forms view and all is well. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top