Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] - نسخه متنی

Alison Balter

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Practical Examples: Practicing What You Learned


I use the techniques covered in this section in many of the applications that I distribute to my users. The report that we'll build could be included in our hypothetical time and billing application. It covers generic techniques that you can use in any application that you build.

One report not covered in the chapter is the rptEmployeeBillingsByProject report. This report has the following code in its NoData event:

Private Sub Report_NoData(Cancel As Integer)
'If no data in the RecordSource underlying the report,
'display a message and cancel printing
MsgBox "There is no data for this report. Canceling report..."
Cancel = True
End Sub

If there's no data in the report's RecordSource, a message box is displayed, and the report is canceled. The Open event of the report looks like this:

Private Sub Report_Open(Cancel As Integer)
'Open the criteria form
DoCmd.OpenForm "frmReportDateRange", _
WindowMode:=acDialog, _
OpenArgs:="Employee Billings by Project"
'If the criteria form is not loaded, cancel printing
If Not IsLoaded("frmReportDateRange") Then
Cancel = True
End If
End Sub

The report's Open event opens a form called frmReportDateRange (see Figure 10.21). This form is required because it supplies criteria to the query underlying the report. If the form isn't loaded successfully, the report is canceled.

Figure 10.21. A criteria selection form.


Finally, the report's Close event looks like this:

Private Sub Report_Close()
'Close the criteria form when the report closes
DoCmd.Close acForm, "frmReportDateRange"
End Sub

The report cleans up after itself by closing the criteria form.


/ 544