Start by creating a form with a combo box to select the primary key of the
record you want to report. Then, use the command button wizard to create a
button to open your report. Edit the code created by the wizard to apply a
where condition. Your code might end up something like this depending on your
controls and report names and data type of the field.
Private Sub cmdRptCustLabels_Click()
On Error GoTo Err_cmdRptCustLabels_Click
Dim stDocName As String
Dim strWhere As String 'added
stDocName = "Customer Labels"
If Not IsNull(Me.cboName) Then
strWhere = "[NameField]='" & Me.cboName & "'"
End If
DoCmd.OpenReport stDocName, acPreview, , strWhere
Exit_cmdRptCustLabels_Click:
Exit Sub
Err_cmdRptCustLabels_Click:
MsgBox Err.Number & vbCrLf & Err.Description
Resume Exit_cmdRptCustLabels_Click
End Sub