IIF Criteria based on selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is what I am trying to do and I am not sure how to exactly go about it.
To simplify things I am using a basic example. I have a form where a
selection is being made, in this case food. based on the selection from the
form easy enough. However if "Pizza" is selected I want to issue a criteria
to prompt for input for a specific pizza place. If anything else is selected
then everything else but. Every time I try this It prompts to enter the name
reguardless of the selection. I have had success with IIF in the past but
this is the first I wanted a response only for a specific criteria so I am
assuming it's my technique. I hope I have posted enough information and
details. Thanks in advance for any and all help

SELECT Resturant.Type, Resturant.Resturants
FROM Resturant
WHERE iif((((Resturant.Type)=[Forms]![Food
Type]![CBO_Food]))="Pizza",(((Type)=[Forms]![Food Type]![CBO_Food]) AND
((Resturants)=[Enter Pizza Place])),(((Resturant.Type)=Forms![Food
Type]!CBO_Food)))
 
I would create another text box in the form where the user can input the
specific pizza place, that way if he made a spelling mistake and the query
return nothing, then he wont have to type everyting again.

Also, if there a table that list the all pizza places, you can create a
ComboBox.
 
Back
Top