Rounding to two decimals via Visual basic (Microsoft access) (1 Viewer)

adi2011

Registered User.
Local time
Today, 08:32
Joined
May 1, 2011
Messages
60
Hi,

in my database (access 2007) I have code similar to this

Dim Ulaz As String, Izlaz As String, UkKol As String, UkFin As String

and at the end of the code I have this

Me.NC = UkFin / UkKol

Me.NC respresents avaerage price.

If for result I have 0.498 value, I would like for that value to be shown as 0.50. In another words, it must be rounded to two places.

How can I do that in VB? That value will be passed to NC field on Form, however..

Many thanks in a dvance for prompt reply!

All the best,
Adi
 

bob fitz

AWF VIP
Local time
Today, 16:32
Joined
May 23, 2011
Messages
4,728
Perhaps the Round() function is required. Something like:
Me.NC = Round(UkFin / UkKol, 2)
 

KenHigg

Registered User
Local time
Today, 11:32
Joined
Jun 9, 2004
Messages
13,327
round()

?

edit: have to be fast :)
 

Users who are viewing this thread

Top Bottom