I am getting this error:
The setting for this property is too long.
If I select the first criteria of Commissioning it works great...but if I select something else I get that error:
Private Sub Command212_Click()
Dim strWhere As String
Dim lngLen As Long
If Me.cboFilterCommissioning = -1 Then
strWhere = strWhere & "([Commissioning] = True) AND "
ElseIf Me.cboFilterCommissioning = 0 Then
strWhere = strWhere & "([Commissioning] = False) AND "
End If
If Me.cboFilterSteamLineBlowing = -1 Then
strWhere = strWhere & "([Steam Line Blowing] = True) AND "
ElseIf Me.cboFilterSteamLineBlowing = 0 Then
strWhere = strWhere & "([Steam Line Blowing] = False) AND "
End If
If Me.cboFilterChemicalCleaning = -1 Then
strWhere = strWhere & "([Chemical Cleaning] = True) AND "
ElseIf Me.cboFilterChemicalCleaning = 0 Then
strWhere = strWhere & "([Chemical Cleaning] = False) AND "
End If
If Me.cboFilterCommissioningIandE = -1 Then
strWhere = strWhere & "([Commissioning I and E] = True) AND "
ElseIf Me.cboFilterCommissioningIandE = 0 Then
strWhere = strWhere & "([Commissioning I and E] = False) AND "
End If
If Me.cboFilterTurnoverCoordination = -1 Then
strWhere = strWhere & "([Turnover Coordination] = True) AND "
ElseIf Me.cboFilterTurnoverCoordination = 0 Then
strWhere = strWhere & "([Turnover Coordination] = False) AND "
End If
If Me.cboFilterCommissioningPlanning = -1 Then
strWhere = strWhere & "([Commissioning Planning] = True) AND "
ElseIf Me.cboFilterCommissioningPlanning = 0 Then
strWhere = strWhere & "([Commissioning Planning] = False) AND "
End If
If Me.cboFilterFacilityEvaluation = -1 Then
strWhere = strWhere & "([Facility Evaluation] = True) AND "
ElseIf Me.cboFilterFacilityEvaluation = 0 Then
strWhere = strWhere & "([Facility Evaluation] = False) AND "
End If
If Me.cboFilterOperationPreparedness = -1 Then
strWhere = strWhere & "([Operation Preparedness] = True) AND "
ElseIf Me.cboFilterOperationPreparedness = 0 Then
strWhere = strWhere & "([Operation Preparedness] = False) AND "
End If
If Me.cboFilterCorrosionProgram = -1 Then
strWhere = strWhere & "([Corrosion Program] = True) AND "
ElseIf Me.cboFilterCorrosionProgram = 0 Then
strWhere = strWhere & "([Corrosion Program] = False) AND "
End If
If Me.cboFilterFugitiveEmissionTesting = -1 Then
strWhere = strWhere & "([Fugitive Emission Testing] = True) AND "
ElseIf Me.cboFilterFugitiveEmissionTesting = 0 Then
strWhere = strWhere & "([Fugitive Emission Testing] = False) AND "
End If
If Me.cboFilterNDTCertification = -1 Then
strWhere = strWhere & "([NDT Certification] = True) AND "
ElseIf Me.cboFilterNDTCertification = 0 Then
strWhere = strWhere & "([NDT Certification] = False) AND "
End If
If Me.cboFilterMaintenance = -1 Then
strWhere = strWhere & "([Maintenance] = True) AND "
ElseIf Me.cboFilterMaintenance = 0 Then
strWhere = strWhere & "([Maintenance] = False) AND "
End If
If Me.cboFilterMaintenancePlanning = -1 Then
strWhere = strWhere & "([Maintenance Planning] = True) AND "
ElseIf Me.cboFilterMaintenancePlanning = 0 Then
strWhere = strWhere & "([Maintenance Planning] = False) AND "
End If
If Me.cboFilterPiping = -1 Then
strWhere = strWhere & "([Piping] = True) AND "
ElseIf Me.cboFilterPiping = 0 Then
strWhere = strWhere & "([Piping] = False) AND "
End If
If Me.cboFilterRotating = -1 Then
strWhere = strWhere & "([Rotating] = True) AND "
ElseIf Me.cboFilterRotating = 0 Then
strWhere = strWhere & "([Rotating] = False) AND "
End If
If Me.cboFilterMaintenanceIandE = -1 Then
strWhere = strWhere & "([Maintenance I and E] = True) AND "
ElseIf Me.cboFilterMaintenanceIandE = 0 Then
strWhere = strWhere & "([Maintenance I and E] = False) AND "
End If
If Me.cboFilterOperations = -1 Then
strWhere = strWhere & "([Operations] = True) AND "
ElseIf Me.cboFilterOperations = 0 Then
strWhere = strWhere & "([Operations] = False) AND "
End If
If Me.cboFilterOperationsPlanning = -1 Then
strWhere = strWhere & "([Operations Planning] = True) AND "
ElseIf Me.cboFilterOperationsPlanning = 0 Then
strWhere = strWhere & "([Operations Planning] = False) AND "
End If
If Me.cboFilterScheduling = -1 Then
strWhere = strWhere & "([Scheduling] = True) AND "
ElseIf Me.cboFilterScheduling = 0 Then
strWhere = strWhere & "([Scheduling] = False) AND "
End If
If Me.cboFilterInventoryofSupply = -1 Then
strWhere = strWhere & "([Inventory of Supply] = True) AND "
ElseIf Me.cboFilterInventoryofSupply = 0 Then
strWhere = strWhere & "([Inventory of Supply] = False) AND "
End If
If Me.cboFilterProductMovement = -1 Then
strWhere = strWhere & "([Product Movement] = True) AND "
ElseIf Me.cboFilterProductMovement = 0 Then
strWhere = strWhere & "([Product Movement] = False) AND "
End If
If Me.cboFilterStartUp = -1 Then
strWhere = strWhere & "([Start-Up] = True) AND "
ElseIf Me.cboFilterStartUp = 0 Then
strWhere = strWhere & "([Start-Up] = False) AND "
End If
If Me.cboFilterTemporary = -1 Then
strWhere = strWhere & "([Temporary] = True) AND "
ElseIf Me.cboFilterTemporary = 0 Then
strWhere = strWhere & "([Temporary] = False) AND "
End If
If Me.cboFilterLongTerm = -1 Then
strWhere = strWhere & "([Long-Term] = True) AND "
ElseIf Me.cboFilterLongTerm = 0 Then
strWhere = strWhere & "([Long-Term] = False) AND "
End If
If Me.cboFilterPandIDReviews = -1 Then
strWhere = strWhere & "([PandID Reviews] = True) AND "
ElseIf Me.cboFilterPandIDReviews = 0 Then
strWhere = strWhere & "([PandID Reviews] = False) AND "
End If
If Me.cboFilterPreliminary = -1 Then
strWhere = strWhere & "([Preliminary] = True) AND "
ElseIf Me.cboFilterPreliminary = 0 Then
strWhere = strWhere & "([Preliminary] = False) AND "
End If
If Me.cboFilterAsBuilt = -1 Then
strWhere = strWhere & "([As Built] = True) AND "
ElseIf Me.cboFilterAsBuilt = 0 Then
strWhere = strWhere & "([As Built] = False) AND "
End If
If Me.cboFilterHAZOPParticipation = -1 Then
strWhere = strWhere & "([HAZOP Participation] = True) AND "
ElseIf Me.cboFilterHAZOPParticipation = 0 Then
strWhere = strWhere & "([HAZOP Participation] = False) AND "
End If
If Me.cboFilterTraining = -1 Then
strWhere = strWhere & "([Training] = True) AND "
ElseIf Me.cboFilterTraining = 0 Then
strWhere = strWhere & "([Training] = False) AND "
End If
If Me.cboFilterCreateTrainingMaterial = -1 Then
strWhere = strWhere & "([Create Training Material] = True) AND "
ElseIf Me.cboFilterCreateTrainingMaterial = 0 Then
strWhere = strWhere & "([Create Training Material] = False) AND "
End If
If Me.cboFilterPresenter = -1 Then
strWhere = strWhere & "([Presenter] = True) AND "
ElseIf Me.cboFilterPresenter = 0 Then
strWhere = strWhere & "([Presenter] = False) AND "
End If
If Me.cboFilterTechnicalWriting = -1 Then
strWhere = strWhere & "([Technical Writing] = True) AND "
ElseIf Me.cboFilterTechnicalWriting = 0 Then
strWhere = strWhere & "([Technical Writing] = False) AND "
End If
If Me.cboFilterUnderstandingofMaterial = -1 Then
strWhere = strWhere & "([Understanding of Material] = True) AND "
ElseIf Me.cboFilterUnderstandingofMaterial = 0 Then
strWhere = strWhere & "([Understanding of Material] = False) ANDR "
End If
If Me.cboFilterAutoCAD = -1 Then
strWhere = strWhere & "([AutoCAD] = True) AND "
ElseIf Me.cboFilterAutoCAD = 0 Then
strWhere = strWhere & "([AutoCAD] = False) AND "
End If
If Me.cboFilterPrimavera = -1 Then
strWhere = strWhere & "([Primavera] = True) AND "
ElseIf Me.cboFilterPrimavera = 0 Then
strWhere = strWhere & "([Primavera] = False) AND "
End If
If Me.cboFilterMicroStation = -1 Then
strWhere = strWhere & "([MicroStation] = True) AND "
ElseIf Me.cboFilterMicroStation = 0 Then
strWhere = strWhere & "([MicroStation] = False) AND "
End If
If Me.cboFilterAromatics = -1 Then
strWhere = strWhere & "([Aromatics] = True) AND "
ElseIf Me.cboFilterAromatics = 0 Then
strWhere = strWhere & "([Aromatics] = False) AND "
End If
If Me.cboFilterBiodiesel = -1 Then
strWhere = strWhere & "([Biodiesel] = True) AND "
ElseIf Me.cboFilterBiodiesel = 0 Then
strWhere = strWhere & "([Biodiesel] = False) AND "
End If
If Me.cboFilterBioethanol = -1 Then
strWhere = strWhere & "([Bioethanol] = True) AND "
ElseIf Me.cboFilterBioethanol = 0 Then
strWhere = strWhere & "([Bioethanol] = False) AND "
End If
If Me.cboFilterBPA = -1 Then
strWhere = strWhere & "([BPA] = True) AND "
ElseIf Me.cboFilterBPA = 0 Then
strWhere = strWhere & "([BPA] = False) AND "
End If
If Me.cboFilterButene = -1 Then
strWhere = strWhere & "([Butene] = True) AND "
ElseIf Me.cboFilterButene = 0 Then
strWhere = strWhere & "([Butene] = False) AND "
End If
If Me.cboFilterCatalyst = -1 Then
strWhere = strWhere & "([Catalyst] = True) AND "
ElseIf Me.cboFilterCatalyst = 0 Then
strWhere = strWhere & "([Catalyst] = False) AND "
End If
If Me.cboFilterChlorAlkalai = -1 Then
strWhere = strWhere & "([Chlor-Alkalai] = True) AND "
ElseIf Me.cboFilterChlorAlkalai = 0 Then
strWhere = strWhere & "([Chlor-Alkalai] = False) AND "
End If
If Me.cboFilterCoal = -1 Then
strWhere = strWhere & "([Coal] = True) AND "
ElseIf Me.cboFilterCoal = 0 Then
strWhere = strWhere & "([Coal] = False) AND "
End If
If Me.cboFilterCumene = -1 Then
strWhere = strWhere & "([Cumene] = True) AND "
ElseIf Me.cboFilterCumene = 0 Then
strWhere = strWhere & "([Cumene] = False) AND "
End If
If Me.cboFilterEBSM = -1 Then
strWhere = strWhere & "([EB/SM] = True) AND "
ElseIf Me.cboFilterEBSM = 0 Then
strWhere = strWhere & "([EB/SM] = False) AND "
End If
If Me.cboFilterEthanol = -1 Then
strWhere = strWhere & "([Ethanol] = True) AND "
ElseIf Me.cboFilterEthanol = 0 Then
strWhere = strWhere & "([Ethanol] = False) AND "
End If
If Me.cboFilterEthylene = -1 Then
strWhere = strWhere & "([Ethylene] = True) AND "
ElseIf Me.cboFilterEthylene = 0 Then
strWhere = strWhere & "([Ethylene] = False) AND "
End If
If Me.cboFilterFCCDCC = -1 Then
strWhere = strWhere & "([FCC/DCC] = True) AND "
ElseIf Me.cboFilterFCCDCC = 0 Then
strWhere = strWhere & "([FCC/DCC] = False) AND "
End If
If Me.cboFilterFGD = -1 Then
strWhere = strWhere & "([FGD] = True) AND "
ElseIf Me.cboFilterFGD = 0 Then
strWhere = strWhere & "([FGD] = False) AND "
End If
If Me.cboFilterFossilPlant = -1 Then
strWhere = strWhere & "([Fossil Plant] = True) AND "
ElseIf Me.cboFilterFossilPlant = 0 Then
strWhere = strWhere & "([Fossil Plant] = False) AND "
End If
If Me.cboFilterFuelsDepots = -1 Then
strWhere = strWhere & "([Fuels Depots] = True) AND "
ElseIf Me.cboFilterFuelsDepots = 0 Then
strWhere = strWhere & "([Fuels Depots] = False) AND "
End If
If Me.cboFilterFurnaces = -1 Then
strWhere = strWhere & "([Furnaces] = True) AND "
ElseIf Me.cboFilterFurnaces = 0 Then
strWhere = strWhere & "([Furnaces] = False) AND "
End If
If Me.cboFilterGas = -1 Then
strWhere = strWhere & "([Gas] = True) AND "
ElseIf Me.cboFilterGas = 0 Then
strWhere = strWhere & "([Gas] = False) AND "
End If
If Me.cboFilterGasTreatment = -1 Then
strWhere = strWhere & "([Gas Treatment] = True) AND "
ElseIf Me.cboFilterGasTreatment = 0 Then
strWhere = strWhere & "([Gas Treatment] = False) AND "
End If
If Me.cboFilterGeothermal = -1 Then
strWhere = strWhere & "([Geothermal] = True) AND "
ElseIf Me.cboFilterGeothermal = 0 Then
strWhere = strWhere & "([Geothermal] = False) AND "
End If
If Me.cboFilterGrassroots = -1 Then
strWhere = strWhere & "([Grassroots] = True) AND "
ElseIf Me.cboFilterGrassroots = 0 Then
strWhere = strWhere & "([Grassroots] = False) AND "
End If
If Me.cboFilterHydroElectric = -1 Then
strWhere = strWhere & "([Hydro Electric] = True) AND "
ElseIf Me.cboFilterHydroElectric = 0 Then
strWhere = strWhere & "([Hydro Electric] = False) AND "
End If
If Me.cboFilterHydrocracker = -1 Then
strWhere = strWhere & "([Hydrocracker] = True) AND "
ElseIf Me.cboFilterHydrocracker = 0 Then
strWhere = strWhere & "([Hydrocracker] = False) AND "
End If
If Me.cboFilterHydrotreater = -1 Then
strWhere = strWhere & "([Hydrotreater] = True) AND "
ElseIf Me.cboFilterHydrotreater = 0 Then
strWhere = strWhere & "([Hydrotreater] = False) AND "
End If
If Me.cboFilterLNG = -1 Then
strWhere = strWhere & "([LNG] = True) AND "
ElseIf Me.cboFilterLNG = 0 Then
strWhere = strWhere & "([LNG] = False) AND "
End If
If Me.cboFilterLNGImportTerm = -1 Then
strWhere = strWhere & "([LNG Import Term] = True) AND "
ElseIf Me.cboFilterLNGImportTerm = 0 Then
strWhere = strWhere & "([LNG Import Term] = False) AND "
End If
If Me.cboFilterNapthaCracker = -1 Then
strWhere = strWhere & "([Naptha Cracker] = True) AND "
ElseIf Me.cboFilterNapthaCracker = 0 Then
strWhere = strWhere & "([Naptha Cracker] = False) AND "
End If
If Me.cboFilterOilandGas = -1 Then
strWhere = strWhere & "([Oil and Gas] = True) AND "
ElseIf Me.cboFilterOilandGas = 0 Then
strWhere = strWhere & "([Oil and Gas] = False) AND "
End If
If Me.cboFilterOlefins = -1 Then
strWhere = strWhere & "([Olefins] = True) AND "
ElseIf Me.cboFilterOlefins = 0 Then
strWhere = strWhere & "([Olefins] = False) AND "
End If
If Me.cboFilterPhenolPlant = -1 Then
strWhere = strWhere & "([Phenol Plant] = True) AND "
ElseIf Me.cboFilterPhenolPlant = 0 Then
strWhere = strWhere & "([Phenol Plant] = False) AND "
End If
If Me.cboFilterPolymers = -1 Then
strWhere = strWhere & "([Polymers] = True) AND "
ElseIf Me.cboFilterPolymers = 0 Then
strWhere = strWhere & "([Polymers] = False) AND "
End If
If Me.cboFilterPolypropylene = -1 Then
strWhere = strWhere & "([Polypropylene] = True) AND "
ElseIf Me.cboFilterPolypropylene = 0 Then
strWhere = strWhere & "([Polypropylene] = False) AND "
End If
If Me.cboFilterPolysilicon = -1 Then
strWhere = strWhere & "([Polysilicon] = True) AND "
ElseIf Me.cboFilterPolysilicon = 0 Then
strWhere = strWhere & "([Polysilicon] = False) AND "
End If
If Me.cboFilterPolystyrene = -1 Then
strWhere = strWhere & "([Polystyrene] = True) AND "
ElseIf Me.cboFilterPolystyrene = 0 Then
strWhere = strWhere & "([Polystyrene] = False) AND "
End If
If Me.cboFilterProcessPlant = -1 Then
strWhere = strWhere & "([Process Plant] = True) AND "
ElseIf Me.cboFilterProcessPlant = 0 Then
strWhere = strWhere & "([Process Plant] = False) AND "
End If
If Me.cboFilterRefinery = -1 Then
strWhere = strWhere & "([Refinery] = True) AND "
ElseIf Me.cboFilterRefinery = 0 Then
strWhere = strWhere & "([Refinery] = False) AND "
End If
If Me.cboFilterRegassification = -1 Then
strWhere = strWhere & "([Regassification] = True) AND "
ElseIf Me.cboFilterRegassification = 0 Then
strWhere = strWhere & "([Regassification] = False) AND "
End If
If Me.cboFilterRevamp = -1 Then
strWhere = strWhere & "([Revamp] = True) AND "
ElseIf Me.cboFilterRevamp = 0 Then
strWhere = strWhere & "([Revamp] = False) AND "
End If
If Me.cboFilterRFCC = -1 Then
strWhere = strWhere & "([RFCC] = True) AND "
ElseIf Me.cboFilterRFCC = 0 Then
strWhere = strWhere & "([RFCC] = False) AND "
End If
If Me.cboFilterRippleTrays = -1 Then
strWhere = strWhere & "([Ripple Trays] = True) AND "
ElseIf Me.cboFilterRippleTrays = 0 Then
strWhere = strWhere & "([Ripple Trays] = False) AND "
End If
If Me.cboFilterServices = -1 Then
strWhere = strWhere & "([Services] = True) AND "
ElseIf Me.cboFilterServices = 0 Then
strWhere = strWhere & "([Services] = False) AND "
End If
If Me.cboFilterVCMUnit = -1 Then
strWhere = strWhere & "([VCM Unit] = True) AND "
ElseIf Me.cboFilterVCMUnit = 0 Then
strWhere = strWhere & "([VCM Unit] = False) AND "
End If
If Me.cboFilterWasteWater = -1 Then
strWhere = strWhere & "([Waste Water] = True) AND "
ElseIf Me.cboFilterWasteWater = 0 Then
strWhere = strWhere & "([Waste Water] = False) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
It doesn't seem to like the lngLen which makes it not like the Me.Filter either...
I have no idea how to fix it?
The setting for this property is too long.
If I select the first criteria of Commissioning it works great...but if I select something else I get that error:
Private Sub Command212_Click()
Dim strWhere As String
Dim lngLen As Long
If Me.cboFilterCommissioning = -1 Then
strWhere = strWhere & "([Commissioning] = True) AND "
ElseIf Me.cboFilterCommissioning = 0 Then
strWhere = strWhere & "([Commissioning] = False) AND "
End If
If Me.cboFilterSteamLineBlowing = -1 Then
strWhere = strWhere & "([Steam Line Blowing] = True) AND "
ElseIf Me.cboFilterSteamLineBlowing = 0 Then
strWhere = strWhere & "([Steam Line Blowing] = False) AND "
End If
If Me.cboFilterChemicalCleaning = -1 Then
strWhere = strWhere & "([Chemical Cleaning] = True) AND "
ElseIf Me.cboFilterChemicalCleaning = 0 Then
strWhere = strWhere & "([Chemical Cleaning] = False) AND "
End If
If Me.cboFilterCommissioningIandE = -1 Then
strWhere = strWhere & "([Commissioning I and E] = True) AND "
ElseIf Me.cboFilterCommissioningIandE = 0 Then
strWhere = strWhere & "([Commissioning I and E] = False) AND "
End If
If Me.cboFilterTurnoverCoordination = -1 Then
strWhere = strWhere & "([Turnover Coordination] = True) AND "
ElseIf Me.cboFilterTurnoverCoordination = 0 Then
strWhere = strWhere & "([Turnover Coordination] = False) AND "
End If
If Me.cboFilterCommissioningPlanning = -1 Then
strWhere = strWhere & "([Commissioning Planning] = True) AND "
ElseIf Me.cboFilterCommissioningPlanning = 0 Then
strWhere = strWhere & "([Commissioning Planning] = False) AND "
End If
If Me.cboFilterFacilityEvaluation = -1 Then
strWhere = strWhere & "([Facility Evaluation] = True) AND "
ElseIf Me.cboFilterFacilityEvaluation = 0 Then
strWhere = strWhere & "([Facility Evaluation] = False) AND "
End If
If Me.cboFilterOperationPreparedness = -1 Then
strWhere = strWhere & "([Operation Preparedness] = True) AND "
ElseIf Me.cboFilterOperationPreparedness = 0 Then
strWhere = strWhere & "([Operation Preparedness] = False) AND "
End If
If Me.cboFilterCorrosionProgram = -1 Then
strWhere = strWhere & "([Corrosion Program] = True) AND "
ElseIf Me.cboFilterCorrosionProgram = 0 Then
strWhere = strWhere & "([Corrosion Program] = False) AND "
End If
If Me.cboFilterFugitiveEmissionTesting = -1 Then
strWhere = strWhere & "([Fugitive Emission Testing] = True) AND "
ElseIf Me.cboFilterFugitiveEmissionTesting = 0 Then
strWhere = strWhere & "([Fugitive Emission Testing] = False) AND "
End If
If Me.cboFilterNDTCertification = -1 Then
strWhere = strWhere & "([NDT Certification] = True) AND "
ElseIf Me.cboFilterNDTCertification = 0 Then
strWhere = strWhere & "([NDT Certification] = False) AND "
End If
If Me.cboFilterMaintenance = -1 Then
strWhere = strWhere & "([Maintenance] = True) AND "
ElseIf Me.cboFilterMaintenance = 0 Then
strWhere = strWhere & "([Maintenance] = False) AND "
End If
If Me.cboFilterMaintenancePlanning = -1 Then
strWhere = strWhere & "([Maintenance Planning] = True) AND "
ElseIf Me.cboFilterMaintenancePlanning = 0 Then
strWhere = strWhere & "([Maintenance Planning] = False) AND "
End If
If Me.cboFilterPiping = -1 Then
strWhere = strWhere & "([Piping] = True) AND "
ElseIf Me.cboFilterPiping = 0 Then
strWhere = strWhere & "([Piping] = False) AND "
End If
If Me.cboFilterRotating = -1 Then
strWhere = strWhere & "([Rotating] = True) AND "
ElseIf Me.cboFilterRotating = 0 Then
strWhere = strWhere & "([Rotating] = False) AND "
End If
If Me.cboFilterMaintenanceIandE = -1 Then
strWhere = strWhere & "([Maintenance I and E] = True) AND "
ElseIf Me.cboFilterMaintenanceIandE = 0 Then
strWhere = strWhere & "([Maintenance I and E] = False) AND "
End If
If Me.cboFilterOperations = -1 Then
strWhere = strWhere & "([Operations] = True) AND "
ElseIf Me.cboFilterOperations = 0 Then
strWhere = strWhere & "([Operations] = False) AND "
End If
If Me.cboFilterOperationsPlanning = -1 Then
strWhere = strWhere & "([Operations Planning] = True) AND "
ElseIf Me.cboFilterOperationsPlanning = 0 Then
strWhere = strWhere & "([Operations Planning] = False) AND "
End If
If Me.cboFilterScheduling = -1 Then
strWhere = strWhere & "([Scheduling] = True) AND "
ElseIf Me.cboFilterScheduling = 0 Then
strWhere = strWhere & "([Scheduling] = False) AND "
End If
If Me.cboFilterInventoryofSupply = -1 Then
strWhere = strWhere & "([Inventory of Supply] = True) AND "
ElseIf Me.cboFilterInventoryofSupply = 0 Then
strWhere = strWhere & "([Inventory of Supply] = False) AND "
End If
If Me.cboFilterProductMovement = -1 Then
strWhere = strWhere & "([Product Movement] = True) AND "
ElseIf Me.cboFilterProductMovement = 0 Then
strWhere = strWhere & "([Product Movement] = False) AND "
End If
If Me.cboFilterStartUp = -1 Then
strWhere = strWhere & "([Start-Up] = True) AND "
ElseIf Me.cboFilterStartUp = 0 Then
strWhere = strWhere & "([Start-Up] = False) AND "
End If
If Me.cboFilterTemporary = -1 Then
strWhere = strWhere & "([Temporary] = True) AND "
ElseIf Me.cboFilterTemporary = 0 Then
strWhere = strWhere & "([Temporary] = False) AND "
End If
If Me.cboFilterLongTerm = -1 Then
strWhere = strWhere & "([Long-Term] = True) AND "
ElseIf Me.cboFilterLongTerm = 0 Then
strWhere = strWhere & "([Long-Term] = False) AND "
End If
If Me.cboFilterPandIDReviews = -1 Then
strWhere = strWhere & "([PandID Reviews] = True) AND "
ElseIf Me.cboFilterPandIDReviews = 0 Then
strWhere = strWhere & "([PandID Reviews] = False) AND "
End If
If Me.cboFilterPreliminary = -1 Then
strWhere = strWhere & "([Preliminary] = True) AND "
ElseIf Me.cboFilterPreliminary = 0 Then
strWhere = strWhere & "([Preliminary] = False) AND "
End If
If Me.cboFilterAsBuilt = -1 Then
strWhere = strWhere & "([As Built] = True) AND "
ElseIf Me.cboFilterAsBuilt = 0 Then
strWhere = strWhere & "([As Built] = False) AND "
End If
If Me.cboFilterHAZOPParticipation = -1 Then
strWhere = strWhere & "([HAZOP Participation] = True) AND "
ElseIf Me.cboFilterHAZOPParticipation = 0 Then
strWhere = strWhere & "([HAZOP Participation] = False) AND "
End If
If Me.cboFilterTraining = -1 Then
strWhere = strWhere & "([Training] = True) AND "
ElseIf Me.cboFilterTraining = 0 Then
strWhere = strWhere & "([Training] = False) AND "
End If
If Me.cboFilterCreateTrainingMaterial = -1 Then
strWhere = strWhere & "([Create Training Material] = True) AND "
ElseIf Me.cboFilterCreateTrainingMaterial = 0 Then
strWhere = strWhere & "([Create Training Material] = False) AND "
End If
If Me.cboFilterPresenter = -1 Then
strWhere = strWhere & "([Presenter] = True) AND "
ElseIf Me.cboFilterPresenter = 0 Then
strWhere = strWhere & "([Presenter] = False) AND "
End If
If Me.cboFilterTechnicalWriting = -1 Then
strWhere = strWhere & "([Technical Writing] = True) AND "
ElseIf Me.cboFilterTechnicalWriting = 0 Then
strWhere = strWhere & "([Technical Writing] = False) AND "
End If
If Me.cboFilterUnderstandingofMaterial = -1 Then
strWhere = strWhere & "([Understanding of Material] = True) AND "
ElseIf Me.cboFilterUnderstandingofMaterial = 0 Then
strWhere = strWhere & "([Understanding of Material] = False) ANDR "
End If
If Me.cboFilterAutoCAD = -1 Then
strWhere = strWhere & "([AutoCAD] = True) AND "
ElseIf Me.cboFilterAutoCAD = 0 Then
strWhere = strWhere & "([AutoCAD] = False) AND "
End If
If Me.cboFilterPrimavera = -1 Then
strWhere = strWhere & "([Primavera] = True) AND "
ElseIf Me.cboFilterPrimavera = 0 Then
strWhere = strWhere & "([Primavera] = False) AND "
End If
If Me.cboFilterMicroStation = -1 Then
strWhere = strWhere & "([MicroStation] = True) AND "
ElseIf Me.cboFilterMicroStation = 0 Then
strWhere = strWhere & "([MicroStation] = False) AND "
End If
If Me.cboFilterAromatics = -1 Then
strWhere = strWhere & "([Aromatics] = True) AND "
ElseIf Me.cboFilterAromatics = 0 Then
strWhere = strWhere & "([Aromatics] = False) AND "
End If
If Me.cboFilterBiodiesel = -1 Then
strWhere = strWhere & "([Biodiesel] = True) AND "
ElseIf Me.cboFilterBiodiesel = 0 Then
strWhere = strWhere & "([Biodiesel] = False) AND "
End If
If Me.cboFilterBioethanol = -1 Then
strWhere = strWhere & "([Bioethanol] = True) AND "
ElseIf Me.cboFilterBioethanol = 0 Then
strWhere = strWhere & "([Bioethanol] = False) AND "
End If
If Me.cboFilterBPA = -1 Then
strWhere = strWhere & "([BPA] = True) AND "
ElseIf Me.cboFilterBPA = 0 Then
strWhere = strWhere & "([BPA] = False) AND "
End If
If Me.cboFilterButene = -1 Then
strWhere = strWhere & "([Butene] = True) AND "
ElseIf Me.cboFilterButene = 0 Then
strWhere = strWhere & "([Butene] = False) AND "
End If
If Me.cboFilterCatalyst = -1 Then
strWhere = strWhere & "([Catalyst] = True) AND "
ElseIf Me.cboFilterCatalyst = 0 Then
strWhere = strWhere & "([Catalyst] = False) AND "
End If
If Me.cboFilterChlorAlkalai = -1 Then
strWhere = strWhere & "([Chlor-Alkalai] = True) AND "
ElseIf Me.cboFilterChlorAlkalai = 0 Then
strWhere = strWhere & "([Chlor-Alkalai] = False) AND "
End If
If Me.cboFilterCoal = -1 Then
strWhere = strWhere & "([Coal] = True) AND "
ElseIf Me.cboFilterCoal = 0 Then
strWhere = strWhere & "([Coal] = False) AND "
End If
If Me.cboFilterCumene = -1 Then
strWhere = strWhere & "([Cumene] = True) AND "
ElseIf Me.cboFilterCumene = 0 Then
strWhere = strWhere & "([Cumene] = False) AND "
End If
If Me.cboFilterEBSM = -1 Then
strWhere = strWhere & "([EB/SM] = True) AND "
ElseIf Me.cboFilterEBSM = 0 Then
strWhere = strWhere & "([EB/SM] = False) AND "
End If
If Me.cboFilterEthanol = -1 Then
strWhere = strWhere & "([Ethanol] = True) AND "
ElseIf Me.cboFilterEthanol = 0 Then
strWhere = strWhere & "([Ethanol] = False) AND "
End If
If Me.cboFilterEthylene = -1 Then
strWhere = strWhere & "([Ethylene] = True) AND "
ElseIf Me.cboFilterEthylene = 0 Then
strWhere = strWhere & "([Ethylene] = False) AND "
End If
If Me.cboFilterFCCDCC = -1 Then
strWhere = strWhere & "([FCC/DCC] = True) AND "
ElseIf Me.cboFilterFCCDCC = 0 Then
strWhere = strWhere & "([FCC/DCC] = False) AND "
End If
If Me.cboFilterFGD = -1 Then
strWhere = strWhere & "([FGD] = True) AND "
ElseIf Me.cboFilterFGD = 0 Then
strWhere = strWhere & "([FGD] = False) AND "
End If
If Me.cboFilterFossilPlant = -1 Then
strWhere = strWhere & "([Fossil Plant] = True) AND "
ElseIf Me.cboFilterFossilPlant = 0 Then
strWhere = strWhere & "([Fossil Plant] = False) AND "
End If
If Me.cboFilterFuelsDepots = -1 Then
strWhere = strWhere & "([Fuels Depots] = True) AND "
ElseIf Me.cboFilterFuelsDepots = 0 Then
strWhere = strWhere & "([Fuels Depots] = False) AND "
End If
If Me.cboFilterFurnaces = -1 Then
strWhere = strWhere & "([Furnaces] = True) AND "
ElseIf Me.cboFilterFurnaces = 0 Then
strWhere = strWhere & "([Furnaces] = False) AND "
End If
If Me.cboFilterGas = -1 Then
strWhere = strWhere & "([Gas] = True) AND "
ElseIf Me.cboFilterGas = 0 Then
strWhere = strWhere & "([Gas] = False) AND "
End If
If Me.cboFilterGasTreatment = -1 Then
strWhere = strWhere & "([Gas Treatment] = True) AND "
ElseIf Me.cboFilterGasTreatment = 0 Then
strWhere = strWhere & "([Gas Treatment] = False) AND "
End If
If Me.cboFilterGeothermal = -1 Then
strWhere = strWhere & "([Geothermal] = True) AND "
ElseIf Me.cboFilterGeothermal = 0 Then
strWhere = strWhere & "([Geothermal] = False) AND "
End If
If Me.cboFilterGrassroots = -1 Then
strWhere = strWhere & "([Grassroots] = True) AND "
ElseIf Me.cboFilterGrassroots = 0 Then
strWhere = strWhere & "([Grassroots] = False) AND "
End If
If Me.cboFilterHydroElectric = -1 Then
strWhere = strWhere & "([Hydro Electric] = True) AND "
ElseIf Me.cboFilterHydroElectric = 0 Then
strWhere = strWhere & "([Hydro Electric] = False) AND "
End If
If Me.cboFilterHydrocracker = -1 Then
strWhere = strWhere & "([Hydrocracker] = True) AND "
ElseIf Me.cboFilterHydrocracker = 0 Then
strWhere = strWhere & "([Hydrocracker] = False) AND "
End If
If Me.cboFilterHydrotreater = -1 Then
strWhere = strWhere & "([Hydrotreater] = True) AND "
ElseIf Me.cboFilterHydrotreater = 0 Then
strWhere = strWhere & "([Hydrotreater] = False) AND "
End If
If Me.cboFilterLNG = -1 Then
strWhere = strWhere & "([LNG] = True) AND "
ElseIf Me.cboFilterLNG = 0 Then
strWhere = strWhere & "([LNG] = False) AND "
End If
If Me.cboFilterLNGImportTerm = -1 Then
strWhere = strWhere & "([LNG Import Term] = True) AND "
ElseIf Me.cboFilterLNGImportTerm = 0 Then
strWhere = strWhere & "([LNG Import Term] = False) AND "
End If
If Me.cboFilterNapthaCracker = -1 Then
strWhere = strWhere & "([Naptha Cracker] = True) AND "
ElseIf Me.cboFilterNapthaCracker = 0 Then
strWhere = strWhere & "([Naptha Cracker] = False) AND "
End If
If Me.cboFilterOilandGas = -1 Then
strWhere = strWhere & "([Oil and Gas] = True) AND "
ElseIf Me.cboFilterOilandGas = 0 Then
strWhere = strWhere & "([Oil and Gas] = False) AND "
End If
If Me.cboFilterOlefins = -1 Then
strWhere = strWhere & "([Olefins] = True) AND "
ElseIf Me.cboFilterOlefins = 0 Then
strWhere = strWhere & "([Olefins] = False) AND "
End If
If Me.cboFilterPhenolPlant = -1 Then
strWhere = strWhere & "([Phenol Plant] = True) AND "
ElseIf Me.cboFilterPhenolPlant = 0 Then
strWhere = strWhere & "([Phenol Plant] = False) AND "
End If
If Me.cboFilterPolymers = -1 Then
strWhere = strWhere & "([Polymers] = True) AND "
ElseIf Me.cboFilterPolymers = 0 Then
strWhere = strWhere & "([Polymers] = False) AND "
End If
If Me.cboFilterPolypropylene = -1 Then
strWhere = strWhere & "([Polypropylene] = True) AND "
ElseIf Me.cboFilterPolypropylene = 0 Then
strWhere = strWhere & "([Polypropylene] = False) AND "
End If
If Me.cboFilterPolysilicon = -1 Then
strWhere = strWhere & "([Polysilicon] = True) AND "
ElseIf Me.cboFilterPolysilicon = 0 Then
strWhere = strWhere & "([Polysilicon] = False) AND "
End If
If Me.cboFilterPolystyrene = -1 Then
strWhere = strWhere & "([Polystyrene] = True) AND "
ElseIf Me.cboFilterPolystyrene = 0 Then
strWhere = strWhere & "([Polystyrene] = False) AND "
End If
If Me.cboFilterProcessPlant = -1 Then
strWhere = strWhere & "([Process Plant] = True) AND "
ElseIf Me.cboFilterProcessPlant = 0 Then
strWhere = strWhere & "([Process Plant] = False) AND "
End If
If Me.cboFilterRefinery = -1 Then
strWhere = strWhere & "([Refinery] = True) AND "
ElseIf Me.cboFilterRefinery = 0 Then
strWhere = strWhere & "([Refinery] = False) AND "
End If
If Me.cboFilterRegassification = -1 Then
strWhere = strWhere & "([Regassification] = True) AND "
ElseIf Me.cboFilterRegassification = 0 Then
strWhere = strWhere & "([Regassification] = False) AND "
End If
If Me.cboFilterRevamp = -1 Then
strWhere = strWhere & "([Revamp] = True) AND "
ElseIf Me.cboFilterRevamp = 0 Then
strWhere = strWhere & "([Revamp] = False) AND "
End If
If Me.cboFilterRFCC = -1 Then
strWhere = strWhere & "([RFCC] = True) AND "
ElseIf Me.cboFilterRFCC = 0 Then
strWhere = strWhere & "([RFCC] = False) AND "
End If
If Me.cboFilterRippleTrays = -1 Then
strWhere = strWhere & "([Ripple Trays] = True) AND "
ElseIf Me.cboFilterRippleTrays = 0 Then
strWhere = strWhere & "([Ripple Trays] = False) AND "
End If
If Me.cboFilterServices = -1 Then
strWhere = strWhere & "([Services] = True) AND "
ElseIf Me.cboFilterServices = 0 Then
strWhere = strWhere & "([Services] = False) AND "
End If
If Me.cboFilterVCMUnit = -1 Then
strWhere = strWhere & "([VCM Unit] = True) AND "
ElseIf Me.cboFilterVCMUnit = 0 Then
strWhere = strWhere & "([VCM Unit] = False) AND "
End If
If Me.cboFilterWasteWater = -1 Then
strWhere = strWhere & "([Waste Water] = True) AND "
ElseIf Me.cboFilterWasteWater = 0 Then
strWhere = strWhere & "([Waste Water] = False) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
It doesn't seem to like the lngLen which makes it not like the Me.Filter either...
I have no idea how to fix it?