Label printing problem

G

Guest

I have a table with a Yes/No Chexkbox to mark records which I would like to
print on a label. The report I did and it looks OK.
I used the following:

Private Sub cmdPrintLabel_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[print record] = " & Me.[print record]
DoCmd.OpenReport "labelscontactedpersons", acViewNormal, , strWhere
End If
End Sub

The problem is that even if I check the yes/no bos the program ignores the
order - it prints every record in my table. How can I only print the records
which I selected?
 
J

Jeff L

You have a method to set print record to true, but once you print your
records, do you have a way to set it to false? I belive that is why
you are getting all your records to print. Your filter is set to look
for all records where Print_Record is true, but if the Print_Record
field in your table never gets set to False, then you are always going
to print all your records. You need another button or something that
you can click so that once your labels are printed, you can set the
print record field to false.

Hope that helps!
 

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