Mailing labels, choosing the ones I want to print

G

Guest

I have a report for printing labels, I have a dialog box to choose a name,
however I can only choose one name for the report. Can I make this so I can
choose the names I want to print labels for with all the names being on one
report? Don't know if you need this, here is the event procedure for the
dialog box. I stole it from the sample database.

Private Sub cmdApplyFilter_Click()
Dim strNAME As String
Dim strFilter As String
' Check that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "MAILING LABEL") <>
acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
' Build criteria string for Office field
If IsNull(Me.cboNAME.Value) Then
strNAME = "Like '*'"
Else
strNAME = "='" & Me.cboNAME.Value & "'"
End If
' Combine criteria strings into a WHERE clause for the filter
strFilter = "[NAME] " & strNAME
' Apply the filter and switch it on
With Reports![MAILING LABEL]
.Filter = strFilter
.FilterOn = True
End With
End Sub

Private Sub cmdRemoveFilter_Click()
On Error Resume Next
' Switch the filter off
Reports![MAILING LABEL].FilterOn = False
End Sub
 
G

Guest

I figured it out. Thanks for all the help I have been receiving. I am sure I
will have more questions before this project is done. Why do I volunteer for
stuff like this?
 
J

John Vinson

Why do I volunteer for stuff like this?

"The punishment for doing a job well is that you'll be asked to do it
again"...

Sorry we didn't get you a timely answer, and glad you worked it out.
Please don't hesitate to post back, one of the volunteers here should
be able to help!


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top