Query based on ComboBox (1 Viewer)

RevJeff

Registered User.
Local time
Yesterday, 21:26
Joined
Sep 18, 2002
Messages
125
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.
 

mike60smart

Registered User.
Local time
Today, 02:26
Joined
Aug 6, 2017
Messages
1,913
Hi

Can you show a screenshot of your query?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:26
Joined
May 7, 2009
Messages
19,247
actually the construct is wrong.
maybe this:

=IIf([Forms]![frmDashboard]![Yard]="All Yards", tableName.[fieldToDisplay] ,[Forms]![frmDashboard]![Yard])
 

RevJeff

Registered User.
Local time
Yesterday, 21:26
Joined
Sep 18, 2002
Messages
125
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: 57
  • Capture1.JPG
    Capture1.JPG
    26.9 KB · Views: 51

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:26
Joined
May 7, 2009
Messages
19,247
You're welcome Rev.
 

Users who are viewing this thread

Top Bottom