IIF or something like that

  • Thread starter Thread starter pgarcia
  • Start date Start date
P

pgarcia

Database is already setup and it runs a job, I'm just adding to it.

1. Table has two fields: field 1 = ABEABE, field 2 = ABEZone9. The next
line is like so: ABEABI, ABIZone9, next line; ABEABQ, ABQZone9, and so on.
2. Querie 1 gets data from an already excesting querie: Addess to line
together; Field 1 = ABE, Field 2 = ABE, Field 3 (Expr1) = ABEABE, Field 3 = 1.
3. So, I need to do a IIF (or someother thing that I'm sure what it is):
IIf([StateZone combo]![Field2]=[CMS_Text_File_Combo]![Expr1],[StateZone
combo]![Field2])
But it doesn't work. I'm not geting the correct data, it's repiting. Then I
need the following: IIf([StateZone
combo]![Field3]=[CMS_Text_File_Combo]![Expr1],[CMS_Text_File_Combo]![Field 3])
Thanks for the help
 
Database is already setup and it runs a job, I'm just adding to it.

1. Table has two fields: field 1 = ABEABE, field 2 =  ABEZone9. Thenext
line is like so: ABEABI, ABIZone9, next line; ABEABQ, ABQZone9, and so on..
2. Querie 1 gets data from an already excesting querie:  Addess to line
together; Field 1 = ABE, Field 2 = ABE, Field 3 (Expr1) = ABEABE, Field 3 = 1.
3. So, I need to do a IIF (or someother thing that I'm sure what it is):
IIf([StateZone combo]![Field2]=[CMS_Text_File_Combo]![Expr1],[StateZone
combo]![Field2])
But it doesn't work. I'm not geting the correct data, it's repiting. ThenI
need the following: IIf([StateZone
combo]![Field3]=[CMS_Text_File_Combo]![Expr1],[CMS_Text_File_Combo]![Field 3])
Thanks for the help

What do you need to do with this result? Just show it on your form?
IF so, just create the IIF statement and make it the control source of
an unbound textbox on your form. Use the wizard to write the IIF
statement.
 
SELECT [BAXSaver US].Field1, [BAXSaver US].Field2, [BAXSaver
US]![Field1]+[BAXSaver US]![Field2] AS Expr1, [BAXSaver US].Field3
FROM [BAXSaver US];

Steve Sanford said:
Please post the SQL of your query.

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


pgarcia said:
Database is already setup and it runs a job, I'm just adding to it.

1. Table has two fields: field 1 = ABEABE, field 2 = ABEZone9. The next
line is like so: ABEABI, ABIZone9, next line; ABEABQ, ABQZone9, and so on.
2. Querie 1 gets data from an already excesting querie: Addess to line
together; Field 1 = ABE, Field 2 = ABE, Field 3 (Expr1) = ABEABE, Field 3 = 1.
3. So, I need to do a IIF (or someother thing that I'm sure what it is):
IIf([StateZone combo]![Field2]=[CMS_Text_File_Combo]![Expr1],[StateZone
combo]![Field2])
But it doesn't work. I'm not geting the correct data, it's repiting. Then I
need the following: IIf([StateZone
combo]![Field3]=[CMS_Text_File_Combo]![Expr1],[CMS_Text_File_Combo]![Field 3])
Thanks for the help
 
Sorry but no. I have a Excel spread sheet and it will input the data from the
DB.

Database is already setup and it runs a job, I'm just adding to it.

1. Table has two fields: field 1 = ABEABE, field 2 = ABEZone9. The next
line is like so: ABEABI, ABIZone9, next line; ABEABQ, ABQZone9, and so on..
2. Querie 1 gets data from an already excesting querie: Addess to line
together; Field 1 = ABE, Field 2 = ABE, Field 3 (Expr1) = ABEABE, Field 3 = 1.
3. So, I need to do a IIF (or someother thing that I'm sure what it is):
IIf([StateZone combo]![Field2]=[CMS_Text_File_Combo]![Expr1],[StateZone
combo]![Field2])
But it doesn't work. I'm not geting the correct data, it's repiting. Then I
need the following: IIf([StateZone
combo]![Field3]=[CMS_Text_File_Combo]![Expr1],[CMS_Text_File_Combo]![Field 3])
Thanks for the help

What do you need to do with this result? Just show it on your form?
IF so, just create the IIF statement and make it the control source of
an unbound textbox on your form. Use the wizard to write the IIF
statement.
 
The syntax for the IIF() function is missing the False Value. The syntax is:

IIF( condition, Return-Value-If-True, Return-Value-If-False)


What are:

[StateZone combo]![Field2]
[StateZone combo]![Field3]
[CMS_Text_File_Combo]![Expr1]
[CMS_Text_File_Combo]![Field 3]


If they are combo boxes, combo boxes do not have fields.
If they are queries/tables, you cannot reference queries/tables unless they
are part of the query.


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


pgarcia said:
SELECT [BAXSaver US].Field1, [BAXSaver US].Field2, [BAXSaver
US]![Field1]+[BAXSaver US]![Field2] AS Expr1, [BAXSaver US].Field3
FROM [BAXSaver US];

Steve Sanford said:
Please post the SQL of your query.

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


pgarcia said:
Database is already setup and it runs a job, I'm just adding to it.

1. Table has two fields: field 1 = ABEABE, field 2 = ABEZone9. The next
line is like so: ABEABI, ABIZone9, next line; ABEABQ, ABQZone9, and so on.
2. Querie 1 gets data from an already excesting querie: Addess to line
together; Field 1 = ABE, Field 2 = ABE, Field 3 (Expr1) = ABEABE, Field 3 = 1.
3. So, I need to do a IIF (or someother thing that I'm sure what it is):
IIf([StateZone combo]![Field2]=[CMS_Text_File_Combo]![Expr1],[StateZone
combo]![Field2])
But it doesn't work. I'm not geting the correct data, it's repiting. Then I
need the following: IIf([StateZone
combo]![Field3]=[CMS_Text_File_Combo]![Expr1],[CMS_Text_File_Combo]![Field 3])
Thanks for the help
 
Back
Top