Control Source Format for rounding

I have a box that calculates discounts or allows me to enter a manual amount. 
 The control source for it is :=IIF([Discount]<=0, [ManDisc], 
([DisTx]+[DisNTx])).  The last 2 fields handle taxable and non-taxable 
discounts.  The fields (except for manual)are percentages.  These work OK, 
but I need it to round to only 2 decimal places.  Now when it is stored in 
the table, it sometimes has 3 decimal places which messes with the grand 
total at the end of the day.  Any suggestions?
7/26/2007 10:04:02 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 12

On Thu, 26 Jul 2007 15:04:02 -0700, David <>

>I have a box that calculates discounts or allows me to enter a manual amount. 
> The control source for it is :=IIF([Discount]<=0, [ManDisc], 
>([DisTx]+[DisNTx])).  The last 2 fields handle taxable and non-taxable 
>discounts.  The fields (except for manual)are percentages.  These work OK, 
>but I need it to round to only 2 decimal places.  Now when it is stored in 
>the table, it sometimes has 3 decimal places which messes with the grand 
>total at the end of the day.  Any suggestions?

Just use the built in Round function:

=IIF([Discount]<=0, [ManDisc], 
Round([DisTx]+[DisNTx], 2)).

             John W. Vinson [MVP]
7/26/2007 11:46:20 PM

Similar Artilces:

bound control or inbound control
Hi Katherine, There are differences between using bound versus unbound controls. Where on the form do you want to use an unbound control? Jeanette Cunningham "Katherine" <> wrote in message > ...

why won't word 2007 release control of a .rtf file after exiting w

RE: Control
Can some one point me right direction to achive this following. Need to dispaly a data in a table format. some of the column data may have to display a image/icon based on a value from the table (1 :- Red color icon, 2:-yellow color icon...) Once the data is loaded and displayed on the format , able to search particular row by column index and update the values including the images(change different image). I tried with Listview control, with the report view I am not able to search row and update the columns with the List vew I am not able to show the image/icon. do not want to use ...

MSCRM login and the Users Control Panel
Is anyone aware of any way that the settings stored under Control Panel - Users - Password Management might interfere with the process of Single Sign On into MSCRM? It seemed to have somehow cached someones login and prevented logging in as the logged in user, until cached credentials had been "deleted". However I have never seen this mentioned as being relevant. I am not too sure what the architecture model is there, but it appears to be a single domain. If this area has any relevance, it would be useful to know....thanks ...

custom formats in new sheets
Hello all, Excel2000 I've got some custom formats which I use in pretty well all my spreadsheets. Is there a way to make user-defined custom formats appear in new sheets? When I start a new sheet there are always the standard set of 'custom' formats but the ones I have defined and want to use have to be set up again for that sheet. I'm sure ther is a simple answer to this, something I've been getting by with for over ten years! Actually, related to this question: there are loads of 'custom' formats defined in Excel which I never use but have to scroll through ...

csv format is wrong in Denmark
When I make csv file from excel 2007, then I do not get a comma-separated file. The cells are separated with a semicolon and the the normal dot in numbers is a comma. This is the case when you live in Denmark. The problem with the "Danish" excel csv format is that we can not export it to what ever we want. If I want to use it in Microsoft Visual Studio Team System, for a unit test, then it does understand the format. Is it possible in Office to save in correct cvs format? This is something to be done with the Windows setting. Start>Settings>Control Panel>...

Adding a control variable
Hello all, Under VC++ 7.1, I've added a checkbox to a dialog. Using the dialog editor, I am not trying to add a control variable for this check box. However, when I right-click on the check box and select "Add Variable", the resulting wizard dialog does not allow me to select "Control Variable" (it is grayed out). What do I need to do to get a control variable for this check box added to my class? Thanks, Dave I've never seen that before - are you able to duplicate this problem with other projects too? -- Regards, Nish [VC++ MVP] "Dave" <bett...

Spam control - MS Outlook
Hi! I am using MS Outlook 2000 and use 2 profiles. I recently installed a firewall package (Fsecure = Telia S�ker Surf), including Spam control. After install, MSO hangs and I cannot change to the other profile (if I not removed MSO by ctrl/alt/del) Somebody want to comment this? /Sven-Erik Intergrated AV/Spam is the cause of frequent issues in Outlook Is the FSecure you installed compatible with this old version of Outlook? "Storfille" <> wrote in message news:b1Ixm.11987$ > Hi! > > I am using MS Outlook 200...

EXCEL chart legend formatting
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Can anyone tell me how to get superscript/subscript formatting to show in a chart legend? I've got it working in the excel data cells, but the formattin doesn't transfer to the legend and I can't directly change the legend text. I am having the same problem. Did you ever find a solution? Thanks! tauntonuse wrote: EXCEL chart legend formatting 28-Oct-09 Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Can anyone tell me how to get superscript/subscript formatting to show in a chart legend? I h...

Releasing memory after creating OCX control
Hi, I try to create an instance of an activex control in my MFC dialog based app. Though my application works with out any error, if i check the memory after calling "delete pMyControl" it keeps on occupying the same memory it occupied when the control was alive. Could anyone help me where I am missing to clear the memory? Thank you. My Code here ---------------m_pxWmp= new CWMPPlayer4();if( m_pxWmp->Create("replay", WS_CHILD | WS_BORDER | WS_VISIBLE , CRect(100, 100,320,240), this, 2)){ m_replay = true; m_pxWmp->SetUrl("C:\\video.avi"); m_pxWmp->Set...

xcel Number Formatting Problem
Hi there, I have exported accounting information from a company data website int excel. For some reason, where profit figures had a 1000 seperator (, on the website, when exported into excel the 1000 seperator became decimal point (.). Also, the profit figures taken from the website ar in GDP th i.e. excluding the last '000'. Therefore, please can you help me do the following: 1) Replace the unwanted decimal point (.) back to a 1000 seperato (,). 2) Add 000 to the end of the profit figures so that they are in writte in full. Many thanks And -- andyp16 ------------------------...

stock control system
trying to see up a 'basic stock control sytem' for a warehouse that contains building materials. -- Thank you. You can use multiple ways of doing, there's 3 ways to come to m head... 1) Use a worksheet as database an save all the information on the cell of that worksheet using some macros to access it and handle. 2) You might want to use Access instead of Excel, I think would b easier to handle the database portion and you still have the Macro available. 3) You can use VB with an Access to create an application -- fanay ------------------------------------------------------...

what control can display characters from txt files in a dialog?
I want to read lines from txt files and display them on a dialog.I wonder which control can be put into the dialog to hold the characters from txt? Something like :- while(m_file.ReadString(tmpstr)) { str += tmpstr; } m_edit.SetWindowText(str); -- Regards, Nish [VC++ MVP] "liao_xf" <> wrote in message news:001401c3652f$177b9830$a001280a@phx.gbl... > Thanks first! > I know that Edit control can receive and edit input. > and I know the filestdio can read lines from txt. > but can you tell me how to attatch the lines to the edit? > Thanks!...

Set new message to "Justify" format...not Left??
Greetings, I was wondering if there was a way to have a new mail message automatically be set up for "Justify" instead of "Left" for paragraph formatting. I'm using Outlook 2003 Thanks in advance Are you using Word as the Outlook message editor? -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. ALWAYS post your Outlook version. How to ask a question: After furious head scratching, asked: | Greetings, | | I was wondering if there was a way to have a new ma...

Creating dialog controls at run-time
I've been researching how to do this, but whenever I try what other people do, I get very bad results. But my challenge doesn't end there. The number of controls I want to create is only known at run-time. The problems I face are manifold: 1. The code most people use fails badly. Not only is the font unconventionally big, but when I click the checkbox I create, the whole dialog disappears. If that's not enough, the pointer to the control is NULL when the dialog's destructor is called, so I can't delete the instance, and get a memory leak message when the program ends: CADi...

MDI support in ATL composite control
Hi, I have components created in ATL. The components are ATL composite controls. Entire work has been done till now using ATL, however I now need to give MDI type of work area (based o doc-view architecture) within the control. I have class derived from CMDIFrameWnd. However when I try to initialize instance of this class by calling "Create" method of CFrameWnd (base class in CMDIFrameWnd), I get error and creation fails. Tracing the code, I found that base class create method calls "AfxGetInstanceHandle" to get handle to the DLL. Now since this is ATL Composite control, ...

Default Format Comments
in Excel 2002 is there a way to format all comments at once? or change the default format for new comments? Hi see >-----Original Message----- >in Excel 2002 is there a way to format all comments at >once? or change the default format for new comments? >. > ...

Printing large-format output from Publisher
All, This may not be the "proper" forum for this question, but I'm hoping someone here may have an answer for me. I have a Publisher document (finished size about 11 x 25) that I print using an HP deskjet printer, to both sides of 100 lb. weight glossy paper, 13"w x 26"l; I then trim the sides, top & bottom edges, and fold the completed document into a two-sided three-fold brochure. So far so good. The current printer is OK, but it's slooow and the pages take quite a while to dry before I can print the second side. I've already adjusted ink density...

Can I Sum by Cell Colour or Format?
I have a large list of values, these values have been colour coded. I would like to sum each of the colours seperately. I know i can add a filter, sort by colour & sum this for each coulour, but am wondering if there is a formula that would do this for me? Ashley, have a look here -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Ashley" wrote: > I have a large list of values,...

Formatting columns
How do I create 2 tables (one under the other) such that each table can have the column width adjusted independently? I want column A of the top to be a different width than column A of the bottom table. ------------------------------------------------ ~~ Message posted from ~~ View and post usenet messages directly from You might be able to use Format|Cells|alignment tab to merge cells, but I think I'd put the two tables on different sheets. Even if it's not a necessity today, it'll make things cleaner if you start that way...

View Filtering and Access Controls for Business Units
I am trying to implement MS-CRM for my company. We have multiple Business Units . I need to give views to each Business Units so that they see only their own Contacts/Accounts/Opp lists. How do I accomplish this ? Also, If I gave inter business unit acesses , how do I make sure that the one business unit users can not modify any fields on other's Business Unit's records ? Thanks in advance for any help, Kishore This is quite easy to do with CRM. Assuming you have already created your Business Units in CRM, you can view a security role within one of the Business Units and a...

Changing formating
I have h:mm format in one cell, I would like to change the format to next cell as number but keep the number same for expample. a b 0:21 required to have 21 Please help. Time is stored as a fraction of a day B1: ="required to have " & A1*24 "Kimti" <> wrote in message >I have h:mm format in one cell, I would like to change the format to next > cell as number but keep the number same for expample. > > a ...

Tab Control Problems
I previously worked in VC++ 6.0, and have several applications that have either custom shadebox controls, or tab controls or group boxes. In all cases, when I moved the applications over to VS.NET 2003, everything was fine, except in the resource editor, I cannot see any of the controls that have been overlayed on a tab control, or a custom shadebox control and in some cases group boxes. I can tab to them and see the outline, but I cannot see the actual controls. If I drag a new control onto the tab control, I can see the control, but once it is saved, I can no longer access the cont...

Problem with txt format
Hi everyone! I was wondering if you cound help with a problem I'm having with Excel. I have a list of codes that I want Excel to save in txt format with the "". I'll explain: I have thousands of codes in a numerical format (e.g. 3173471; 3174742, etc.) but I need to save a txt file that puts "" around the value, i.e., "3173471", "3174742", etc. I've tried to use the concatenate function, replace and even tried to program a macro (I'm not that procient in macros, so something could be wrong...) but nothing worked. The best i could ...

Help in programmatically setting formatting in an AppointmentItem
Hi, i have created a macro to generate some meeting invites. I used the WordEditor to set some formatting (Bold on/off, hyperlinks etc). However, i find that the formatting works only partially (or not at all). so far i've noticed that only the first invite generated is perfectly formatted. Can anyone help me out with this? Do i need to add something to the code or set some objects to null to ensure that the formatting stays throughout my outlook session? More info, please: Outlook version, relevant code snippet, more explanation of what you mean by "the first invite...