User function on report?

S

Starry

I have a report that has to do the following

take total number of hours for a given worker on a given day

send this through a whole bunch of rules to churn out the.....
-time
-time and a half
-double time
-over time
-w/e etc etc

.....portions and then calculate the costs based on fixed rates.
it needs to cycle through and do this for each worker on each day of a
specified week.

the result is a nice simple report with total figures. Clearly I would use a
function for this
but can I do that in a report? (I have never done much VBA on reports)

My feeling is that perhaps I should use a form and function to do a make
table and then just
mirror that to a report but I'd rather avoid all of this and don't see why I
cannot transform the
raw data at report stage....I just don't know how.
(ie should I call a function, put the routine on the report etc)

Any ideas/resources?
 
D

Damian S

Hi Starry,

In a query you can call user functions, so you could have a query calculate
all the bits and pieces required, then use THAT for the report's recordsource.

Hope this helps.

Damian.
 
M

Marshall Barton

Starry said:
I have a report that has to do the following

take total number of hours for a given worker on a given day

send this through a whole bunch of rules to churn out the.....
-time
-time and a half
-double time
-over time
-w/e etc etc

....portions and then calculate the costs based on fixed rates.
it needs to cycle through and do this for each worker on each day of a
specified week.

the result is a nice simple report with total figures. Clearly I would use a
function for this
but can I do that in a report? (I have never done much VBA on reports)

My feeling is that perhaps I should use a form and function to do a make
table and then just
mirror that to a report but I'd rather avoid all of this and don't see why I
cannot transform the
raw data at report stage....I just don't know how.
(ie should I call a function, put the routine on the report etc)


If the function is Public in a standard module, you should
be able to use the same function on the report the same way
as on the form.

If that gives you some kind of trouble, post back with more
details of where/how you are using the function.
 
S

Starry

Many thanks I'm polishing the function a bit then I'll try both methods!
I'll be back.....
 

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