How to write code for Median

A

AccessDB

I have a textbox that shows Max, Min, Avg, and Median. I have the code
for all expect Median. Can somebody please help.
Example: For Max, I just went into the properties of the textbox, then
in the control source I just put in =Max([Engine Price Est]). What
would it be for Median?
 
J

Jeff Boyce

MS Access doesn't have a built-in "Median" function. Excel does.

One possibility, depending on the form of the data you feed it, might be to
set a reference to the Excel object model and "use" the Excel function. But
then you'd need to present the data in a manner that Excel uses...

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
A

AccessDB

MS Access doesn't have a built-in "Median" function. Excel does.

One possibility, depending on the form of the data you feed it, might be to
set a reference to the Excel object model and "use" the Excel function. But
then you'd need to present the data in a manner that Excel uses...

--
Regards

Jeff Boyce
Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/

Microsoft Registered Partnerhttps://partner.microsoft.com/




I have a textbox that shows Max, Min, Avg, and Median. I have the code
for all expect Median. Can somebody please help.
Example: For Max, I just went into the properties of the textbox, then
in the control source I just put in =Max([Engine Price Est]). What
would it be for Median?- Hide quoted text -

- Show quoted text -

Isn't there a code you can put in the Report in the code section.
Can't you choose report footer and put in a code?
 
J

Jeff Boyce

You are certainly welcome to create a procedure that calculates a Median ...
but why reinvent the wheel?! Excel already has a function that does this...

Regards

Jeff Boyce
Microsoft Office/Access MVP

AccessDB said:
MS Access doesn't have a built-in "Median" function. Excel does.

One possibility, depending on the form of the data you feed it, might be
to
set a reference to the Excel object model and "use" the Excel function.
But
then you'd need to present the data in a manner that Excel uses...

--
Regards

Jeff Boyce
Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/

Microsoft Registered Partnerhttps://partner.microsoft.com/




I have a textbox that shows Max, Min, Avg, and Median. I have the code
for all expect Median. Can somebody please help.
Example: For Max, I just went into the properties of the textbox, then
in the control source I just put in =Max([Engine Price Est]). What
would it be for Median?- Hide quoted text -

- Show quoted text -

Isn't there a code you can put in the Report in the code section.
Can't you choose report footer and put in a code?
 

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