Hi,
I'm new to MS Access and studies it through exploration and by reading Q&A's
from Microsoft.com.
I entered syntax query IIf([Field1]>1,(([Field1]+1)-[Field2])) in design
view of queries.This becomes Expr1: IIf([To]>1,(([Field1]+1)-[Field2])), when
I leave the cell. When I enter TableName on Table field and save query,
prompt "Syntax error (comma) in query expression
[TableName].[IIf([Field1]>1,(([Field1]+1)-[Field2]))]" appears. TableName is
same Table from which Field1 and Field 2 come from.
What did I do wrong here?
Also, How can I make the results of my queries appear on my desired fields?
Badly needing your help,
Abel
Jeff L - 27 Jul 2006 15:42 GMT
Take out the TableName from the Table field. If you have more than one
table in your query that use the same field names, your syntax would be
IIf(TableName.[Field1]>1,((TableName.[Field1]+1)-TableName.[Field2]))
Also, the syntax for IIf is IIF(Condition, True, False). There are no
optional parts to IIf, you need to have your statement do something
when your condition (Field1 > 1) is False.
Hope that helps!
Abel - 28 Jul 2006 15:16 GMT
Hi Jeff,
Thanks for making time. I did what you said but I can't say if it worked...
How can I make the result of my query appear on my desired field?
Thanks!
> Take out the TableName from the Table field. If you have more than one
> table in your query that use the same field names, your syntax would be
[quoted text clipped - 6 lines]
>
> Hope that helps!