Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Not Run .......Pls help me!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
This is my code:
'Event open report
Private Sub Report_Open(Cancel As Integer)
Dim Frm As String
Dim FldDATE As String

Frm = "FormName"
FldDATE = "[DATE]"

'Run on Windows2000. This code used to filter data
Me.ServerFilter = getPrintFilter(Frm, FldDATE)
Me.FilterOn = True
End Sub

'Function Filter
Public Function getPrintFilter(Frm As String, FldDATE As String) As String
On Error Resume Next

Dim strFilter As String

'Filter Program
If (Not (IsNull(Forms(Frm)!txtFrmID))) Then
strFilter = "[IP_ID]=" + CStr(Nz(Forms(Frm)!FrmID, "0")) + " AND "
End If
'Filter From date
If (Not (IsNull(Forms(Frm)!TxtFROM))) Then
strFilter = strFilter + FldDATE + ">=" + CStr(Nz(Forms(Frm)!TxtFROM, "")) + " AND "
End If
'Filter To date
If (Not (IsNull(Forms(Frm)!txtTO))) Then
strFilter = strFilter + FldDATE + &quot;<=&quot; + CStr(Nz(Forms(Frm)!txtTO, &quot;&quot;)) + &quot; AND &quot;
End If
If (Len(strFilter) >= 5) Then
strFilter = Left(strFilter, Len(strFilter) - 5)
End If
getPrintFilter = strFilter

Exit_Func:
Exit Function
Err_Func:
ShowErr (Err.Description)
Resume Exit_Func
End Function

I don't know why it run on WindowsXP ,but it not run on Window2000 Professional. Pls help me .....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top