Well it's a way to do it, the other is using excel round function like this.
dim ex as excel.application
dim nn as long
dim x as integer
x = 3
set ex = createobject("excel.application"
nn = ex.worksheetfunction.round(34567.65,x)
debug.print 34567.65 & nn
set ex = nothing
x represent the number off fractionary digits you want to use.
by that way can select how many fractionary digits you need to round.
An interesting approach, but possibly a bit of an overkill in this case given that it has to invoke an instance of Excel to do what is essentially a trivial operation.
Still your post provides a very good example of how easy it is to interface to Excel from Access, and utilise its function set. For this, I'm happy to give you a star. Cheers,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.