How do I set up IIf statements?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am currently setting up an access database and would like some help with an
IIf statement.

I would like to build an expression stating that "If nothing is entered into
the field (Customer address) on each record please go to the customer table
and take the address from there. Basically if there isn't a despatch address
I want to enter the invoice address in the field instead.

Probably very simple but I am getting lots of error messages!
 
I am currently setting up an access database and would like some help with an
IIf statement.

I would like to build an expression stating that "If nothing is entered into
the field (Customer address) on each record please go to the customer table
and take the address from there. Basically if there isn't a despatch address
I want to enter the invoice address in the field instead.

Probably very simple but I am getting lots of error messages!

Next time you have code or an expression that doesn't work please post
what you have already tried. Sometimes our crystal balls gets foggy!
Also, sometimes it makes a difference where you are trying to do this.
A Form, Report, Query, VBA, etc.
Let us know.

As a guess...

=IIf(IsNull([CustomerAddress]),DLookUp("[AddressField]","CustomerTable","[CustomerID]
= " & [CustomerID]),[CustomerAddress])

The above assumes that [CustomerID] is the name of your record's
unique prime key field, is a number datatype, and is available on the
form or report that this is being done on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Criteria IIf statement 4
Multiple iif challenge 2
IIF statements 2
iif statement 2
Complicated IIf Statement Problem 24
Iif Statement help 6
iif statement 5
Help with Iif Statement 5

Back
Top