Solved

IIf Question

Posted on 2013-05-30
2
420 Views
Last Modified: 2013-05-30
Am using query designer and have an IIf issue.

Here is my statement:

MoldingSection: IIf([Pattern_Type]="Airset" & "*","Airset",[Pattern_Type])

Now to explain...  sometimes the [PatternType] field is "Airset Line", or "Airset Floor" or maybe just "Airset"  But in this field I want the result to be just "Airset" (dropping the 2nd word).  But in some cases the result may be "Floor" or "SPO" in which case I want the real result to display.

I suspect that the "Airset" & "*" part of my code is at fault but I can't figure out what it should be.
0
Comment
Question by:SteveL13
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39209099
MoldingSection: IIf(Instr([Pattern_Type],"Airset")>0,"Airset",[Pattern_Type])

or


MoldingSection: IIf([Pattern_Type] Like "Airset" & "*","Airset",[Pattern_Type])
0
 

Author Comment

by:SteveL13
ID: 39209164
This did it:

MoldingSection: IIf([Pattern_Type] Like "Airset" & "*","Airset",[Pattern_Type])
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question