473,396 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access 2010 Compound Conditional

I have code IIF(test,true, false)where true or false can be another IIF condition, The true or false for that conditional can also be another IIF. All conditions are seperated by "," and the expression ends with the corect number of ")" (one for each IIF). I get an error missing "bar" or "bracket" invalid syntax. I have tried another format using a ")" at the end of each secondary IIF and still get an error. The statement has 8 IIFs.

IIF([a]= [c], "True", IIF([b] = [d],"true",IIF([x] = [y],"true",IIF(........

I have also tried
IIF({a] = [c], IIF([d] = [e], "true", "False")
IIF([a] = [d], IIF([g] = [h], "true", "false")).....(four more IIFs follow.

Suggestions?
Mar 31 '12 #1
3 2611
I think I found the problem. There was an action for each true and false for each condition EXCEPT for the last condition; I was missing a "False" action for this condition.
Mar 31 '12 #2
Mihail
759 512MB
As an advice:
When create nested IIFs create it separately. Then, for bottom to top, nest its.
Example:
Expand|Select|Wrap|Line Numbers
  1. IIF([a]= [c], "True",)
  2. IIF([b] = [d],"true",)
  3. IIF([x] = [y],"true",LastResultIfFalse)

Now, cut the last IIF and paste into the false part to upper one:
Expand|Select|Wrap|Line Numbers
  1. IIF([a]= [c], "True",)
  2. IIF([b] = [d],"true",IIF([x] = [y],"true",LastResultIfFalse))

Repeat the operation:
Expand|Select|Wrap|Line Numbers
  1. IIF([a]= [c], "True",IIF([b] = [d],"true",IIF([x] = [y],"true",LastResultIfFalse)))

If this nested IIFs must be in a Query, use VBA editor until you obtain the code then paste this code into the query.
Apr 1 '12 #3
NeoPa
32,556 Expert Mod 16PB
Doug, "What's the problem with this formula?" type questions don't work too well without the whole and complete formula being included ;-)
Apr 1 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Top Gun | last post by:
I am trying to code for a compound conditional in the DataView.RowFilter but don't quite no how to do the correct syntax for this. The following code sample chokes on dv.RowFilter: int batchid...
1
by: phill86 | last post by:
Hi, I have an access 2010 database that I want to convert to an SQL Server database and I need to know if the data macros in access will still work in the SQL database or will i have to create...
5
by: jaad | last post by:
Hello, I have a database that was written in access 2007 on my pc. I wanted to work off site with the database so I uploaded it onto my laptop which is loaded with access 2010 beta. When I...
2
by: sierra7 | last post by:
It seems Access 2010 is associating an 'input mask' or field type with a combo box when a form is opened, even though there is no Format setting on the control. I have a form which has been...
2
by: dougancil | last post by:
I have a user who had deleted some records from a database today using Access 2010. They have an ID field that's autonumbered. They have No Duplicates allowed. When they created a new record today,...
0
by: Andolino | last post by:
In Access 2010 I get a Write Conflict error - "This record has been changed by another user..." In Access 2007 this Code is working - why? Private Sub Form_BeforeUpdate(Cancel As Integer) Dim...
1
by: Alan Yim | last post by:
Hi folks, My company recently upgraded our Office suite from 2003 to 2010. The problem in particular is with an Access database that was originally designed in Access 2003. The code in question...
2
by: Bill Boord | last post by:
I need to be able to shut off the AutoCorrect "feature" within Access 2010 code. I have utilized Application.SetOption with method strings for other startup requirements, but I cannot seem to find a...
1
dsatino
by: dsatino | last post by:
I have numerous applications built in Access 2000/2003 that all use ODBCdirect workspaces to access various non-Access databases. Unfortunately, ODBCdirect is 'no longer supported'in Access 2010 and...
1
by: Music Man | last post by:
Greetings All: I built a database in Microsoft SQL Server 2000 and used Microsoft Access 2010 as the front end. The database is used to keep track of "issues" that rise out of my employment. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.