'打印按钮单击
Private Sub cmdPrint_Click()
Dim RcdCount, i
'先清除空白记录
CurrentDb.Execute "DELETE * FROM Bill WHERE PID=0"
'取现有当前记录数
RcdCount = objList.Form.Recordset.RecordCount
'插入需要的空白记录(例如满页为50行,则插入(50-现有记录数)条空白记录)
For i = 1 To (50 - RcdCount)
CurrentDb.Execute "INSERT INTO Bill(PID) VALUES(0)"
Next
'打开报表
DoCmd.OpenReport "rptBill", acViewPreview
DoCmd.Maximize
End Sub