mardi 24 mars 2015

Access Query Form with multiple Checkboxes

i have a newbie question and would appreciate every help. I have a form that runs a query. The query is based on one single table. In this table there are several Projects.(Project 1, Project2,Project3....etc)


In the form there are several checkboxes, where the user can choose which projects he wants to chek. the thing is with my code if i check 2 projects he shows only the records where both projects are selected in the table. But the I want it to show all the records where either of them is shown. Ex. If i chech the boxes for Project1 and the checkbox for Project2 it should show the records where Project 1 is checked and also the records where Project 2 are also checked.



SELECT Vergabeumfang.S63T4, *
FROM Vergabeumfang
WHERE (

((Vergabeumfang.VSS_LAW) Like "*" & [Forms]![Vergabeumfang]![VSS_LAW_Box] & "*" Or (Vergabeumfang.VSS_LAW) Is Null)

And ((IIf([Forms]![Vergabeumfang]![S63T4_box]=-1,([Vergabeumfang].[S63T4])=True,([Vergabeumfang].[S63T4])=False or ((Vergabeumfang.[S63T4])=True ))))


And ((IIf([Forms]![Vergabeumfang]![S63T2_box]=-1,([Vergabeumfang].[S63T2])=True,([Vergabeumfang].[S63T2])=False or ((Vergabeumfang.[S63T2])=True ))))


AND ((Vergabeumfang.V_Commodity_Name) Like "*" & [Forms]![Vergabeumfang]![Commodity_Name_Box] & "*" Or (Vergabeumfang.V_Commodity_Name) Is Null)

;




Aucun commentaire:

Enregistrer un commentaire