Hi
I am using a list box in a form (frmPlantListDialog) as the criteria for a query. The list box has 4 rows. I want the criteria to say:
IIf([Forms]![frmPlantListDialog]![cboPType]=1,1 Or 2,IIf([Forms]![frmPlantListDialog]![cboPType]=2,3 Or 4,IIf([Forms]![frmPlantListDialog]![cboPType]=3,5,[PLANT_TYPE_ID])))
However, the true part of the statement doesn't work with the OR. It works fine otherwise, so the problem is with the OR. How do I write the code for this? I've tried various methods, but none have worked.
Thanks.
I am using a list box in a form (frmPlantListDialog) as the criteria for a query. The list box has 4 rows. I want the criteria to say:
IIf([Forms]![frmPlantListDialog]![cboPType]=1,1 Or 2,IIf([Forms]![frmPlantListDialog]![cboPType]=2,3 Or 4,IIf([Forms]![frmPlantListDialog]![cboPType]=3,5,[PLANT_TYPE_ID])))
However, the true part of the statement doesn't work with the OR. It works fine otherwise, so the problem is with the OR. How do I write the code for this? I've tried various methods, but none have worked.
Thanks.