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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With this CODE 1

Status
Not open for further replies.

Cricker2u

Technical User
Aug 31, 2006
6
CA
Good day! I have some code here that I would like to get some help identifing an IF statement.

=IIf([txt_Country]<>"CA",[rpt_txt_Tot_ROEC]*0.25,IIf([txt_RRSP]<>0,0,IIf([cmb_Province]="QC",IIf([rpt_txt_Tot_ROEC]>5000,[rpt_txt_Tot_ROEC]*0.1,[rpt_txt_Tot_ROEC]*0.05),[rpt_txt_Tot_ROEC]*0.1)))


Could someone help me with:
([rpt_txt_Tot_ROEC]>5000

What is the calculation when its < 5000 with the code that is there??

Thanks in advance

Chris
 
If Country is "CA" and RRSP=0 and Province = "QC" and [rpt_txt_Tot_ROEC] is less than or equal to 5000

your answer should be

[rpt_txt_Tot_ROEC]*0.05

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Chris,
You should not write business calculations like this in a complex expression in a control source or query. This type of calc should be handle in a user defined function in a module named something like "modBusinessCalcs".

This would be much more maintainable.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top