access 2000 rounddown expression

  • Thread starter Thread starter SAM
  • Start date Start date
S

SAM

I am seeking advice on how to get this function to work in
ACCESS2000. I keep getting undefined function 'rounddown'
in expression. I have installed the MSOWCF.DLL and still
get the erro. Any help would be greatly appreciate.
 
Hi Sandy,

My name is Dennis Schmidt. Thank you for using the Microsoft Newsgroups.

The Roundup and Rounddown functions are actually Excel functions. They
cannot be used directly from Access, but can be called from within an
Access function.

Function myCalc(mynum As Double, mynum1 As Double)

Dim obj As Excel.Application
Dim i As Double

Set obj = CreateObject("Excel.Application")
i = obj.Application.RoundUp(mynum, mynum1)
myCalc = i
obj.Quit
Set obj = Nothing

End Function

* Make sure database has a reference to Excel Object Library
* When calling function from query, use the following syntax in a new
column in query:

Expr1: mycalc([num2],0)

Also see these Knowledge Base articles:

Q209996 ACC2000: How to Round a Number Up or Down by a Desired Increment
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q209996

Q210564 ACC2000: Round or Truncate Currency Values to Intended Number
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q210564

Alternatively, you can use automation to call the Excel function from
Access. This
is demonstrated in the following Knowledge Base article:

Q198571 ACC2000: How to Call Excel Functions from Within Access
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q198571


I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support
 
Hi Dennis, thank you also for using the Microsoft Newsgroups.

Can you please explain why you are instantiating an Excel.Application
object? If you have set a reference to the Excel Object Library,
surely you can use the RoundUp function directly e.g.

i = Excel.WorksheetFunction.RoundUp(mynum, mynum1)

Or am I missing something?
 
Thank you so much Dennis, it worked like a charm. Thank
You!
-----Original Message-----
Hi Sandy,

My name is Dennis Schmidt. Thank you for using the Microsoft Newsgroups.

The Roundup and Rounddown functions are actually Excel functions. They
cannot be used directly from Access, but can be called from within an
Access function.

Function myCalc(mynum As Double, mynum1 As Double)

Dim obj As Excel.Application
Dim i As Double

Set obj = CreateObject("Excel.Application")
i = obj.Application.RoundUp(mynum, mynum1)
myCalc = i
obj.Quit
Set obj = Nothing

End Function

* Make sure database has a reference to Excel Object Library
* When calling function from query, use the following syntax in a new
column in query:

Expr1: mycalc([num2],0)

Also see these Knowledge Base articles:

Q209996 ACC2000: How to Round a Number Up or Down by a Desired Increment
http://support.microsoft.com/default.aspx?scid=kb;EN- US;Q209996

Q210564 ACC2000: Round or Truncate Currency Values to Intended Number
http://support.microsoft.com/default.aspx?scid=kb;EN- US;Q210564

Alternatively, you can use automation to call the Excel function from
Access. This
is demonstrated in the following Knowledge Base article:

Q198571 ACC2000: How to Call Excel Functions from Within Access
US;Q198571


I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support

.
 
Back
Top