Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183

    Question Unanswered: if checked don't display

    Hopefully somebody can help me a bit with this or give some kind of idea as how to go about it.

    THIS IS THE CODE FOR THE FILTER BUTTON:

    Private Function BuildFilter() As String

    Dim sFilter As String

    On Error GoTo errApplyEmplFilter

    sFilter = ""

    If Not IsNull(txtReportID) And Not [txtReportID] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Report ID] = " & txtReportID & ") "
    End If

    If Not IsNull(txtStreetNo) And Not [txtStreetNo] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Street Number] = '" & txtStreetNo & "') "
    End If

    If Not IsNull(txtReceiptNum) And Not [txtReceiptNum] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Receipt Number] = '" & txtReceiptNum & "') "
    End If


    If Not IsNull(txtPropFile) And Not [txtPropFile] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([PropertyFileNum] = '" & txtPropFile & "') "
    End If

    If Not IsNull(txtPermitNum) And Not [txtPermitNum] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([PermitNumber] = '" & txtPermitNum & "') "
    End If

    If Not IsNull(txtDemolishNum) And Not [txtDemolishNum] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([DemolisherPermitNo] = '" & txtDemolishNum & "') "
    End If

    If [chkOnHold] = True Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([OnHoldYN] = TRUE ) "
    End If
    If Not IsNull(txtLotNo) And Not [txtLotNo] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Lot Number] = '" & txtLotNo & "') "
    End If
    If Not IsNull(cboStreet) Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Location of Builders Damage Table].[Street ID] = " & cboStreet.Column(0) & ") "
    End If

    If Not IsNull(cboBuildingSurveyor) And Not [cboBuildingSurveyor] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Surveyor Id No] = " & cboBuildingSurveyor & ")"
    End If

    If Not IsNull(cboDevelopmentTypes) And Not [cboDevelopmentTypes] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Development Type] = '" & cboDevelopmentTypes & "')"
    End If

    If Not IsNull(cboOwner) And Not [cboOwner] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Owner Name Id No] = " & cboOwner & ")"
    End If

    If Not IsNull(cboBuilder) And Not [cboBuilder] = " " Then
    If sFilter <> "" Then
    sFilter = sFilter & " AND "
    End If
    sFilter = sFilter & " ([Builder Id No] = " & cboBuilder & ")"
    End If


    BuildFilter = sFilter
    errApplyEmplFilter_Exit:
    Exit Function

    errApplyEmplFilter:
    Select Case Err
    Case Else
    MsgBox Error$
    End Select
    Resume errApplyEmplFilter_Exit

    End Function



    On a tab called "pgWorksCompleted" there is a check box "chkBuildingWorksCompleted" and when that check box is selected record is considered to be CLOSED.

    I would like my filter option to look at this field and see if it is checked and therefore not to display the relevant record.

    Could somebody help me with some sample code please?

  2. #2
    Join Date
    Jun 2004
    Posts
    96
    my logical thinking is that the 'check' option must reside in the table for every record, in order to 'remember' if the record is closed or not.
    then modify your filter to include check = false..

    something like that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •