error msg.

R

Ran BD

guys I'm trying to calculate a future date using dateadd statement, the
statement I'm using is:
=DateAdd("m",[Warrenty_Period],[Purchesed_Date])
while I don't have a value for the warranty_period field the unbound field
display error, after I'm entering the value for the warranty_period it
recalculate the statement and display the right value.
how do I solve this ?

thanks

Ran
 
S

Sandra Daigle

You can use an embedded iif() statement to sort out the null condition on
Warranty Period:

=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))
 
R

Ran BD

and where do I place the embedded iif() statement? on the default vale
section ?

Sandra Daigle said:
You can use an embedded iif() statement to sort out the null condition on
Warranty Period:

=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran said:
guys I'm trying to calculate a future date using dateadd statement,
the statement I'm using is:
=DateAdd("m",[Warrenty_Period],[Purchesed_Date])
while I don't have a value for the warranty_period field the unbound
field display error, after I'm entering the value for the
warranty_period it recalculate the statement and display the right
value.
how do I solve this ?

thanks

Ran
 
S

Sandra Daigle

I would put the whole expression in the controlsource of a textbox - the
value really shouldn't be stored since it is a value derived from other
values and thus can be recalculated when needed.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran said:
and where do I place the embedded iif() statement? on the default vale
section ?

Sandra Daigle said:
You can use an embedded iif() statement to sort out the null
condition on Warranty Period:
=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran said:
guys I'm trying to calculate a future date using dateadd statement,
the statement I'm using is:
=DateAdd("m",[Warrenty_Period],[Purchesed_Date])
while I don't have a value for the warranty_period field the unbound
field display error, after I'm entering the value for the
warranty_period it recalculate the statement and display the right
value.
how do I solve this ?

thanks

Ran
 
R

Ran BD

the thing is that there is an error in the statement that I can't find
=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))
what am I doing wrong (other then my english)?


Sandra Daigle said:
I would put the whole expression in the controlsource of a textbox - the
value really shouldn't be stored since it is a value derived from other
values and thus can be recalculated when needed.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran said:
and where do I place the embedded iif() statement? on the default vale
section ?
=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran BD wrote:
guys I'm trying to calculate a future date using dateadd statement,
the statement I'm using is:
=DateAdd("m",[Warrenty_Period],[Purchesed_Date])
while I don't have a value for the warranty_period field the unbound
field display error, after I'm entering the value for the
warranty_period it recalculate the statement and display the right
value.
how do I solve this ?

thanks

Ran
 
S

Sandra Daigle

This should work, I just created a test case just to be sure. One thing I
did notice is that I used different spellings for the control names (sorry
about that!)

You had Warrenty_Period and Purchesed_Date, I used Warranty_Period and
Purchased_Date. Try replacing my names with yours and see if it works.


=iif(isnull([Warrenty_Period]),null,dateadd("m",[Warrenty_Period],[Purchesed
_Date]))

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran said:
the thing is that there is an error in the statement that I can't find
=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))
what am I doing wrong (other then my english)?


Sandra Daigle said:
I would put the whole expression in the controlsource of a textbox -
the value really shouldn't be stored since it is a value derived
from other values and thus can be recalculated when needed.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Ran said:
and where do I place the embedded iif() statement? on the default
vale section ?

You can use an embedded iif() statement to sort out the null
condition on Warranty Period:
=iif(isnull([warranty_period]),null,dateadd("m",[warranty_period],[purchesed
_date]))


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this
newsgroup.


Ran BD wrote:
guys I'm trying to calculate a future date using dateadd
statement, the statement I'm using is:
=DateAdd("m",[Warrenty_Period],[Purchesed_Date])
while I don't have a value for the warranty_period field the
unbound field display error, after I'm entering the value for the
warranty_period it recalculate the statement and display the right
value.
how do I solve this ?

thanks

Ran
 

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

Top