J
jwr
Following is code for a parameter form that I created to work with my Bill
of Lading Form:
Private Sub Preview_Report_Click()
On Error GoTo Err_Preview_Report_Click
Dim stDocName As String
stDocName = "Bill of lading"
DoCmd.OpenReport stDocName, acPreview
Exit_Preview_Report_Click:
Exit Sub
Err_Preview_Report_Click:
MsgBox Err.Description
Resume Exit_Preview_Report_Click
End Sub
This is the code on the bill of lading:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Canceling report..."
Cancel = -1
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "ParamControl#"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "ParamControl#", , , , , acDialog, "Bill of Lading"
If Not IsLoaded("ParamControl#") Then
Cancel = True
End If
End Sub
Query which report is based on - criteria for control number field:
The form "pops up" and asks for my control numbers - beginning and ending.
I then click preview report and I get blank gray screen.
when I run the query, I get empty fields. I have used this same principal
on other paramter forms and it works. Can you see what I have done wrong?
Thank you for your help.
of Lading Form:
Private Sub Preview_Report_Click()
On Error GoTo Err_Preview_Report_Click
Dim stDocName As String
stDocName = "Bill of lading"
DoCmd.OpenReport stDocName, acPreview
Exit_Preview_Report_Click:
Exit Sub
Err_Preview_Report_Click:
MsgBox Err.Description
Resume Exit_Preview_Report_Click
End Sub
This is the code on the bill of lading:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Canceling report..."
Cancel = -1
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "ParamControl#"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "ParamControl#", , , , , acDialog, "Bill of Lading"
If Not IsLoaded("ParamControl#") Then
Cancel = True
End If
End Sub
Query which report is based on - criteria for control number field:
<=[forms]![ParamControl#]![Ending ControlNum]=[forms]![ParamControl#]![Beginning ControlNum] And
The form "pops up" and asks for my control numbers - beginning and ending.
I then click preview report and I get blank gray screen.
when I run the query, I get empty fields. I have used this same principal
on other paramter forms and it works. Can you see what I have done wrong?
Thank you for your help.