Query based on ComboBox

RevJeff

Registered User.
Local time
Today, 18:42
Joined
Sep 18, 2002
Messages
129
Hello everyone,

So I have a query that is based off of a ComboBox, which has 6 choices. It has the name of 5 different Shuttle Yards and the last choice is "All Yards". Below is the code in my query, but when I run it I get the following error. "The expression is typed incorrectly, or it is too complex to be evaluated...."


Code:
=IIf([Forms]![frmDashboard]![Yard]="All Yards","Mebane" Or "Hope Mills" Or "Wilmington" Or "New Bern" Or "Selma",[Forms]![frmDashboard]![Yard])

Thanks for any help you can offer.
 
actually the construct is wrong.
maybe this:

=IIf([Forms]![frmDashboard]![Yard]="All Yards", tableName.[fieldToDisplay] ,[Forms]![frmDashboard]![Yard])
 
I have attached a screenshot of my query and the ComboBox. Oh, and [Yard] is the name of the ComboBox.
 

Attachments

  • Capture.JPG
    Capture.JPG
    93.5 KB · Views: 102
  • Capture1.JPG
    Capture1.JPG
    26.9 KB · Views: 97
You're welcome Rev.
 

Users who are viewing this thread

Back
Top Bottom