N
Normangerman
How can I enable the IF() function in an Access 2000 table?
The Tick said:The IIf() statement can also be applied to queries. You may want to make a
query to use this statement instead of a table. For example:
IIf([Field1]=1, "yes", "no")
I hope this might work for you
Graham R Seach said:Norman,
I'm sure what Tom meant to say is the following:
1. There is no IF() function. What you're probably thinking of is the IIf()
function.
2. IIf() is a VBA function. VBA functions cannot be applied to tables; only
to forms and reports.
What are you trying to do?
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Normangerman said:No, the IF function like in Excel
=IF (A=B, Yes, No)
The Tick said:The IIf() statement can also be applied to queries. You may want to make
a
query to use this statement instead of a table. For example:
IIf([Field1]=1, "yes", "no")
I hope this might work for you
Graham R Seach said:Norman,
I'm sure what Tom meant to say is the following:
1. There is no IF() function. What you're probably thinking of is the
IIf()
function.
2. IIf() is a VBA function. VBA functions cannot be applied to tables;
only
to forms and reports.
What are you trying to do?
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Graham R Seach said:neither Access or Excel have an If() function!
You can only use IF in VBA, whereas you can use IIF in VBA and SQL. You
can't use either in tables
Jamie Collins said:You missed the fact that IIF may be used in a query, a query can be
used to create a VIEW, table=relation, VIEW=relation, so saying you
can't use IIF in a table is a bit of a technicality.
Graham R Seach said:Exactly my points. I didn't realise I wasn't clear. Thanks Doug.
Jamie Collins said:Getting back to the OP's point, I said:
"IIF may be used in a query, a query can be used to create a VIEW...
In MS Access UI, I think the OP needs to (create) a 'stored query'
object."
Does anyone agree this is best advice or want to suggest an
alternative?