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

Function Results in a Report

Status
Not open for further replies.

david6633

Programmer
Jul 28, 2003
39
GB
I am sure that this question must have been asked before but I cannot see it anywhere.

My poroblem is that I have not done any VBA programming for quite a while - in fact the last time was in Access 97. I have now graduated to Access 2002 and it has changed!

I have written a function to do a calculation - this works but what I now need to do is get the result from the function to be displayed on a report and I cannot find/work out how to do it.

Could someone point me in the right direction please?

David
Remember: You only know what you know
and - you don't know what you don't know!
 
Just add a text box to your report with
= your sumfunction()
as control source.

;-)

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
That is what I have done but it does not work

David
Remember: You only know what you know
and - you don't know what you don't know!
 
[3eyes] Hmmmhh....
Where have you placed the function? In a module? If not: do so.
[mumble]
...strange...
[/mumble]
 
OK I know why it was not working - I had not set the reurn value (as I said it is quite a while since I last tried VBA in Access)

I do now have another problem, which I suspect is something to do with the way I have coded the function, and that is that the function is only picking up the data for the first record in the table but uses it on the report for every record.

Any clues as to what I may have done wrong?

David
Remember: You only know what you know
and - you don't know what you don't know!
 
Is the control source returning the function value in the details area of the report? Same level as your records displayed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top