I have a combo box on a form that has only three values, ‘All’, ‘Pet’, or ‘Shoe’.
The logic I’m trying to achieve is as follows:
If selected branch = “Shoe” then Branch = “01”
If selected branch = “Pet” then Branch = “05”
If selected branch = “Both Shoe & Pet” then Branch = “01” or “05”
Here is my WHERE statement code from my query:
WHERE ((dbo_SalesHisItemPcVw.Branch)=IIf([Forms]![frmRollingDates]![cboBranch]="Shoe","01",IIf([Forms]![frmRollingDates]![cboBranch]="Pet","05","01" Or "05"))
The “Or” statement does not work.
“01” & “05” represent the alpha values of the branches in the table.
The logic I’m trying to achieve is as follows:
If selected branch = “Shoe” then Branch = “01”
If selected branch = “Pet” then Branch = “05”
If selected branch = “Both Shoe & Pet” then Branch = “01” or “05”
Here is my WHERE statement code from my query:
WHERE ((dbo_SalesHisItemPcVw.Branch)=IIf([Forms]![frmRollingDates]![cboBranch]="Shoe","01",IIf([Forms]![frmRollingDates]![cboBranch]="Pet","05","01" Or "05"))
The “Or” statement does not work.
“01” & “05” represent the alpha values of the branches in the table.