Formatting decimal place with form name etc.

F

fishqqq

Forms![fShpSpec]!Round([Text258],2)

I have a Text field that I need to update with a number - [Text258]
&"Pcs" expression but the [Text258] comes from another form and has
too many decimal places.

How do i format the setvalue expression to include the whole form &
field name etc?

Thanks
STeve
 
J

John W. Vinson

Forms![fShpSpec]!Round([Text258],2)

I have a Text field that I need to update with a number - [Text258]
&"Pcs" expression but the [Text258] comes from another form and has
too many decimal places.

How do i format the setvalue expression to include the whole form &
field name etc?

Thanks
STeve

Turn your expression inside out. Round() is a function; pass it the form
reference as an argument:

Round([Forms]![fShpSpec]![Text258], 2)

Note that this will cause an error if the field is null - if that's going to
happen sometimes use

Round(NZ([Forms]![fShpSpec]![Text258]), 2)
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
F

fishqqq

Forms![fShpSpec]!Round([Text258],2)
I have a Text field that I need to update with a number - [Text258]
&"Pcs" expression but the [Text258] comes from another form and has
too many decimal places.
How do i format the setvalue expression to include the whole form &
field name etc?
Thanks
STeve

Turn your expression inside out. Round() is a function; pass it the form
reference as an argument:

Round([Forms]![fShpSpec]![Text258], 2)

Note that this will cause an error if the field is null - if that's goingto
happen sometimes use

Round(NZ([Forms]![fShpSpec]![Text258]), 2)
--

             John W. Vinson [MVP]
 Microsoft's replacements for these newsgroups:
 http://social.msdn.microsoft.com/Forums/en-US/accessdev/
 http://social.answers.microsoft.com/Forums/en-US/addbuz/
 and see alsohttp://www.utteraccess.com

thanks John, that works perfectly
 

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