Hello Fred:
Sorry to jump into this thread, but I've been looking for the same answer
and found your suggestion.
DoCmd.OpenReport "ReportName",acViewPreview, , Me.Filter
I tried it and it worked, but it works when there are filtered records. When
there are no filtered records, my report produces only the partial records. I
have about 100 records in a table, but the report shows only about 40
records. I am wondering if you can give some advice.
Here is my code:
{starts}
Private Sub cmdPreview_Report_Click()
On Error Resume Next
Dim sCriteria As String
sCriteria = " 1 = 1 "
If FindCompany <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.CompanyName =
""" & FindCompany & """"
End If
If FindSize <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.JawsSize =
""" & FindSize & """"
End If
If cboFilterFenestrated <> "" Then
sCriteria = sCriteria & " AND
Q_Biopsy_Product.JawsFenestrated = """ & cboFilterFenestrated & """"
End If
If FindProduct <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.ProductName =
""" & FindProduct & """"
End If
If FindVolume <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.JawsVolume =
""" & FindVolume & """"
End If
If FindLength <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.Length = """
& FindLength & """"
End If
If FindUsage <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.UsageArea =
""" & FindUsage & """"
End If
If cboFilterPE <> "" Then
sCriteria = sCriteria & " AND Q_Biopsy_Product.PE = """ &
cboFilterPE & """"
End If
DoCmd.OpenReport "T_Biopsy_Product", acPreview, , Me.Filter
End Sub
{ends}