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

How and where do I declare a Global/Public Variable ?? 1

Status
Not open for further replies.

toptech

Programmer
Apr 12, 2001
71
US
Hi There.

I am trying to create a variale that can be used in a report for adding numbers based on criteria.

I would have these statements in the detail section:
if cost<200 then cost1=cost1+cost
else
cost1=cost1+cost
end if


I would like to show cost1 in report footer section.

In otherwords, cost1 is a total of all those costs <200.

Thanks for your help in advance.

Jeff-TopTech



Top Tech Systems

If you help 3 people and each one of those help 3 other people and so on, imagine all the people being helped.
 
You could declare the variable at the beginning of the module belonging to the report, but, if I understand your point, this might suit better:
=Sum(IIf([Cost]<200,[Cost],0))
 

Hi Remou.

Your suggestion gave me an idea.
I have solved the problem.

Thanks for your help.

Jeff

Top Tech Systems

If you help 3 people and each one of those help 3 other people and so on, imagine all the people being helped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top