Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stuck on nested iifs

Status
Not open for further replies.

mizsydney

Technical User
May 5, 2005
33
US
it seems like this should be simple enough, but I can't seem to get my brain around it. I need to compare and calculate several fields in order to create flags that warn the user that certain parameters have been exceeded. I have worked with nested IIFs before, but this has me stumped.

if the datediff of [replacement date] minus [original date] is less than or equal to 0 (a negative number), then [replacement price] cannot exceed [original price]. if it does, I need a flag to say "replacement exceeds original" (so far I have been using unbound text boxes for my flags, they are invisible unless the conditions are True.)

if the datediff is greater than 1 and equal to or lesser than 12, then [replacement price] cannot exceed ([original price]*1.05). if it does, I need a flag to say "replacement exceeds original"

if the datediff is greater than 12 and equal to or lesser than 24, then [replacement price] cannot exceed ([original price]*1.1). if it does, I need a flag to say "replacement exceeds original"

all this in one field would be perfect, but at this point I would be thrilled with three separate text boxes.

replacement date, original date, replacement price, original price are all fields to be entered by the user. if the values exceed the limits I want the user to know so they don't waste more time on the claim.

I hope this makes sense. I would be happy to post what I have so far, but I'm so far off that I'm afraid it might lead someone down the wrong path along with me.

help! can anyone point me in the right direction?
 
I wouldn't use a nested iff for something of that complexity, I'd write a function to check and validate everything, then call that function in the relevant event procedures...

--------------------
Procrastinate Now!
 
thanks for your quick reply!

I was trying to use nested IIFs because that is one of the few things in Access that I am (barely) familiar with. I know even less about functions and event procedures.

this doesn't seem that complex in my head, but I just can't get it onto paper.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top