mustangcoupe
Technical User
Ok friends... This one is probaly easy but it is too late and the Patriots are playing and I cant concentrate!
filtertype is a combo box bound to a table with combo box caption, field name, sql string for filterby rowsource
filterby is a combo box with diffrent 2 columns( 1 ID number, 2 description)
filterby2 is a plain old text box
using the first half of the if (filterby is > then 0) then I get an enter parimiter value for the filterd field... (it isnt using the filterby control)
--Todd
TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
filtertype is a combo box bound to a table with combo box caption, field name, sql string for filterby rowsource
filterby is a combo box with diffrent 2 columns( 1 ID number, 2 description)
filterby2 is a plain old text box
using the first half of the if (filterby is > then 0) then I get an enter parimiter value for the filterd field... (it isnt using the filterby control)
Code:
Private Sub Filterform_Click()
Dim strErrNum As String
Dim strErrDesc As String
On Error GoTo Filterform_Click_Error
Dim strFilter As String
If Me.FilterOn = False Then
strFilter = ""
If Len(Me.filterby) > 0 Then
strFilter = Me.filtertype.Column(1) & " =" & Me.filterby
Debug.Print strFilter
Else
If Len(Me.filterby2) > 0 Then
strFilter = Me.filtertype.Column(1) & " =" & Me.filterby2
End If
End If
Me.Filter = strFilter
Me.FilterOn = True
Me.Filterform.Caption = "Remove Filter"
Else
strFilter = ""
Me.Filter = ""
Me.FilterOn = False
Me.filtertype = ""
Me.filterby = ""
Me.filterby2 = ""
Me.Filterform.Caption = "Filter Records"
End If
On Error GoTo 0
Exit Sub
Filterform_Click_Error:
strErrNum = Err.Number
strErrDesc = Err.Description
MsgBox "An error has occured." & Err.Number & " (" & Err.Description & ") An email will be created and sent to Database Administrator."
Call EmailError(strErrNum, strErrDesc)
End Sub
--Todd
TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)