Printing empty forms

B

Brown

Using MS Access 2003 Pro

On a form I have a command button set to print selected records. On a data
input form, there is a check box (default is checked) that identifies the
record(s) to print. When the button is clicked, all records with a check
get printed, and a macro then executes an update query the clears the check
box in the record.

This all works well. However, if no records are checked, and the user
clicks the "Print Records" button, an empty form is printed (the form is a
facsimile of a standard data entry form). Is there a setting that I can use
to avoid printing the empty form?



Brown
 
P

PC Datasheet

Assuming the checkbox field is named "Selected", put this code at the
beginning of the code behind the print button:
If DCount("[Selected]","NameOfYourTable") = 0 Then
MsgBox "There Are No Records Selected To Check"
Exit Sub
End If
 
B

Brown

It looks like it should do the trick, I am having trouble getting to
actuallyperform. No errors, just no difference.

Brown

PC Datasheet said:
Assuming the checkbox field is named "Selected", put this code at the
beginning of the code behind the print button:
If DCount("[Selected]","NameOfYourTable") = 0 Then
MsgBox "There Are No Records Selected To Check"
Exit Sub
End If

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Brown said:
Using MS Access 2003 Pro

On a form I have a command button set to print selected records. On a data
input form, there is a check box (default is checked) that identifies the
record(s) to print. When the button is clicked, all records with a check
get printed, and a macro then executes an update query the clears the check
box in the record.

This all works well. However, if no records are checked, and the user
clicks the "Print Records" button, an empty form is printed (the form is
a
facsimile of a standard data entry form). Is there a setting that I can use
to avoid printing the empty form?



Brown
 
B

Brown

PC Datasheet,
I got it to work - and I learned a little more about setting up the code,
Thanks for your assist!

Brown

PC Datasheet said:
Assuming the checkbox field is named "Selected", put this code at the
beginning of the code behind the print button:
If DCount("[Selected]","NameOfYourTable") = 0 Then
MsgBox "There Are No Records Selected To Check"
Exit Sub
End If

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Brown said:
Using MS Access 2003 Pro

On a form I have a command button set to print selected records. On a data
input form, there is a check box (default is checked) that identifies the
record(s) to print. When the button is clicked, all records with a check
get printed, and a macro then executes an update query the clears the check
box in the record.

This all works well. However, if no records are checked, and the user
clicks the "Print Records" button, an empty form is printed (the form is
a
facsimile of a standard data entry form). Is there a setting that I can use
to avoid printing the empty form?



Brown
 

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