Printing empty forms

  • Thread starter Thread starter Brown
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top