Hi All,
I do try to open a report with a command button from a form, the report should be filtered depending on the users choice on the form.
FORM
Private Sub cmdPrint_Click()
Dim stgFilter As String
'Filter not transfered ??????????
stgFilter = "([Type] = '" & Me.lstProject & "')"
DoCmd.OpenReport "rptPojectOffshore", acViewPreview, stgFilter
End Sub
When opening the report the filter seems not to work? Even the first attempt to print the filter gives no (blanc) return.
REPORT
Private Sub Report_Open(Cancel As Integer)
'On Error Resume Next
Debug.Print "Filter: "; Me.filter
End Sub
Who can I get my Filter working?
I have never realy understood the diffrence between using a filter or the WHERE clause.
Thx a lot,
Ludovic
------=_NextPart_000_0170_01C729F5.418FFBF0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 2449
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial size=2>I do try to open a report with a command button
from a form, the report should be filtered depending on the users choice on the
form.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>FORM</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Private Sub cmdPrint_Click()<BR>
Dim stgFilter As String<BR> <BR> 'Filter not
transfered ??????????<BR> stgFilter = "([Type] = '" &
Me.lstProject & "')"<BR> DoCmd.OpenReport
"rptPojectOffshore", acViewPreview, stgFilter<BR> <BR>End
Sub<BR> <BR>When opening the report the filter seems not to work? Even the
first attempt to print the filter gives no (blanc) return.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>REPORT</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Private Sub Report_Open(Cancel As
Integer)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> 'On Error Resume
Next<BR> <BR> Debug.Print "Filter: ";
Me.filter</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>End Sub<BR> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Who can I get my Filter working?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have never realy understood the diffrence between
using a filter or the WHERE clause.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial size=2>Thx a lot,<BR>Ludovic</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0170_01C729F5.418FFBF0--