Iif returns True part not False

  • Thread starter Thread starter james d
  • Start date Start date
J

james d

I have two tables and the following code to determine price for an item when
entering a new record. It is returning the [Current Price.Sales Price] when
it is True but never give me the False


=IIf([Current Price.Sales Price] Is Not Null,[Current Price.Sales
Price],[TMC Price.DA Price])
 
Where are you creating the new record - in a form?
Is the table [TMC Price] in the query feeding the form?
 
Yes, in a form and I am using the expression builder. When I look at
properties the Iif is in before update. I assume this will pull in the price
once the item is entered?

KARL DEWEY said:
Where are you creating the new record - in a form?
Is the table [TMC Price] in the query feeding the form?
--
KARL DEWEY
Build a little - Test a little


james d said:
I have two tables and the following code to determine price for an item when
entering a new record. It is returning the [Current Price.Sales Price] when
it is True but never give me the False


=IIf([Current Price.Sales Price] Is Not Null,[Current Price.Sales
Price],[TMC Price.DA Price])
 
I might try rearranging the brackets to the following.

=IIf([Current Price].[Sales Price] Is Not Null,
[Current Price].[Sales Price],[TMC Price].[DA Price])

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
If you have some code, you should provide it so we understand the context of
your issue. I'm not sure if you are setting an actual value or a default.

If this is in a form, you should remove the table names and try:
=Nz([Sales Price], [DA Price])

--
Duane Hookom
Microsoft Access MVP


james d said:
Yes, in a form and I am using the expression builder. When I look at
properties the Iif is in before update. I assume this will pull in the price
once the item is entered?

KARL DEWEY said:
Where are you creating the new record - in a form?
Is the table [TMC Price] in the query feeding the form?
--
KARL DEWEY
Build a little - Test a little


james d said:
I have two tables and the following code to determine price for an item when
entering a new record. It is returning the [Current Price.Sales Price] when
it is True but never give me the False


=IIf([Current Price.Sales Price] Is Not Null,[Current Price.Sales
Price],[TMC Price.DA Price])
 
didn't help.... Nz didn't return any thing. Don't have a query pulling data,
just tables and a form. relationships are as follows:
contacts.customer-current price.customer
contacts.company-existing part quote.company
current price.item-tmc price.item
tmc price.std-std pack.std


John Spencer said:
I might try rearranging the brackets to the following.

=IIf([Current Price].[Sales Price] Is Not Null,
[Current Price].[Sales Price],[TMC Price].[DA Price])

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

james said:
I have two tables and the following code to determine price for an item when
entering a new record. It is returning the [Current Price.Sales Price] when
it is True but never give me the False


=IIf([Current Price.Sales Price] Is Not Null,[Current Price.Sales
Price],[TMC Price.DA Price])
 
Use a query with the two tables joined on your 'product' field to feed the
form.
--
KARL DEWEY
Build a little - Test a little


james d said:
Yes, in a form and I am using the expression builder. When I look at
properties the Iif is in before update. I assume this will pull in the price
once the item is entered?

KARL DEWEY said:
Where are you creating the new record - in a form?
Is the table [TMC Price] in the query feeding the form?
--
KARL DEWEY
Build a little - Test a little


james d said:
I have two tables and the following code to determine price for an item when
entering a new record. It is returning the [Current Price.Sales Price] when
it is True but never give me the False


=IIf([Current Price.Sales Price] Is Not Null,[Current Price.Sales
Price],[TMC Price.DA Price])
 
Back
Top