Modules & VBA :: Filling With Zeros For Two Decimals Places

May 1, 2014

I'm passing a few numbers on to Word and these should always appear with two decimal places, also if it's a whole number etc.

e.g.: 10 -> 10,00 or 9,8 -> 9,80

Depending on the regional settings, the decimal marker can be . or ,

View Replies


ADVERTISEMENT

Decimals Changing To Zeros

Mar 1, 2013

I have a table that I need to enter values into but for some reason when I enter a decimal (ex: .015), it automatically changes to 0. I have the Data Type set as Number, Field Size as Long Integer and Decimal Places to 3. I have another field set the same way and it works fine.

View 2 Replies View Related

Modules & VBA :: Adding Decimals Display Wrong Value

Oct 24, 2014

I have 2 controls on a form cmbFed and cmbState both are formatted as fixed with decimal places as 2. They display the correct values. cmbFed = .18 cmbState = .06 When I add a new control to add the 2. =[cmbFed]+[cmbState] result is .18.06 instead of .24 It looks like it is treating them as text. I even tried to do it in code Me.text639 = Me.cmbFed + Me.cmbState with the same results. It must be something simple I am missing a format for text639?

View 5 Replies View Related

Modules & VBA :: Round To 2 Decimal Places

Apr 1, 2014

Problem: I want to "round" (to 2 decimal places) numbers 1-5 down and 6-9 up. For example:

1.915 = 1.91
1.916 = 1.92

I know this is completely screwy but I have to match numbers up to a purchasing system that seems to be doing just that.

I've researched rounding in Access a lot and I understand Bankers rounding (that won't work), I understand Int() and Fix() both don't do what I need. I've something about rounding half down (which is what I think I need) or Floor which I don't quite understand.

View 14 Replies View Related

Modules & VBA :: Filling Combobox With SQL Data?

Oct 6, 2014

I have a select statement (AlphaName and StaffName are variables) in a module that woks fine, its been tested with a basic insert. what i want to do is get this result into a combo box without creating another table?

Code:
strSQl = "SELECT [Week No] FROM [" & AlphaName & "_Hours] WHERE [Alpha Name] = '" & StaffName & "';"
Me.Week_Cmb.RowSource = strSQl

View 7 Replies View Related

Modules & VBA :: Filling Combobox Dynamically

Jul 24, 2014

I have been spending all my today to fill a combobox dynamically, but have not been able yet.

I have a combobox and a pass-through query in access, which is working fine and fill the details into the combobox via data source. Now what I am planning to do is to update the combobox source as soon as value in a text box changes.

here is the code I am using, but it is not working:

Dim rs As Recordset
Dim qDef As QueryDef
Set qDef = CurrentDb.QueryDefs("get_data")
qDef.SQL = "SELECT Initial + ' (' + Name + ')' uws FROM EM.dbo.UW" _
& " WHERE lob = '" & addSingleQuotation(Me.CMB_LOB.Value) & "'"

Me.cmbUM.RowSource = qDef.SQL
Me.cmbUM.Requery

I also used Recordset, but did not work:

Set rs = CurrentDb.OpenRecordset("get_data")
Me.cmbUM.RowSource = rs!uws

View 2 Replies View Related

Modules & VBA :: Open Email Without Filling Recipient?

Oct 31, 2013

I have the following code (which everyone uses) but I have a challenge.

I ONLY want to use two (maybe three) fields from the database! (Subject & Body... with the POTENTIAL of an attached document.

I want to fill in the "to" section AFTER the email is open. This will allow me to make changes if I need to before it is sent.

Here is the code I am trying to work with. (It should look familiar) but I can't get it to keep outlook open!

Code:
Private Sub SecondEmail_Click()
'open Outlook, attach zip folder or file, send e-mail
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

[Code] .....

View 1 Replies View Related

Modules & VBA :: Change Number Of Decimal Places Based On Value In Textbox On Main Form

Apr 11, 2014

I have a subform that displays doubles in a textbox as fixed with 4 decimal places as default. I have been trying to change the number of decimal places based on the value in a textbox on the main form. I have tried this:

Code:
Forms![Main Form]![Holder_subform].Form![Final PCT].[DecimalPlaces] = CByte(Forms![Main Form].Numdecs)

where [Final PCT] is the textbox on the subform containing the decimal number and Numdecs is the textbox on the main form containing the number of decimals I want to use. I want to implement this Form_Current sub.

View 2 Replies View Related

Modules & VBA :: Filling Excel Template Cells / Save Then Send On Outlook

Jul 13, 2013

I have the code below which takes information from a form on access and sends it over to the correct place on an excel spreadsheet template. This works fine but I then need it to save and send on outlook.

The issue I am having is that the saved document is not attaching to the e-mail. The subject etc all work fine but the excel spreadsheet just doesn't attach. When I go into the folder I have specified for the document to be saved in it isn't there either. :0(

The code for the e-mail "callmail" function works perfectly for word documents but I don't know if it is different for an excel file.

Code:

Private Sub Command154_Click()
On Error Resume Next
Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet
Set appExcel = New Excel.Application

[Code] .....

View 4 Replies View Related

Hiding Decimals

Aug 31, 2005

Hello,I was wondering if anybody knew if it was posslble to show an aproximated value of a field with decimal records. I would like to see only integer values on my form.

View 3 Replies View Related

Decimals And Rounding

Oct 27, 2005

I have a field that holds a unit price. I can't use currency as the data type because the currency type is different for each client. I have another field that specifies the currency type for each department. Up to now I've been using a double format with a 2 decimal places. We now need to increase the decimal places to 4 but don't necessarily want to see all four places if only 2 are required - 1.5000 against 1.50. However if I make the decimals as auto, if I have 1.50 it rounds to 1.5.

Any other way to give a bit of flexibility to this?

Thanks.

Dawn

View 8 Replies View Related

Rouning Decimals

Feb 23, 2005

I am trying to round decimals to either .5 or 0 right now i have it set to 1 decimal place and it rounds to to the next place. So if a user puts in 1.23 it would round to 1.2 instead of 1.0, is there a simple way to solve this issue?

View 1 Replies View Related

Return Age With Decimals?

Oct 18, 2012

Is it possible to return an age as: 21.45 or 64.93?

I have done some searching and can't find any formatting or code to make it work.

I have changed the field format to Fixed and then it gives: 21.00 or 64.00

I like the 2 decimal places for quick at-a-glance-knowing of the age.

Of course I have a formula that returns an age with decimals in EXCEL, that's why I think it should somehow be possible in Access.

View 1 Replies View Related

Help With Decimals In Form Field.

Apr 6, 2006

I have a tblParts that has data in this format 200200.0100 (these are bin numbers). I have created a form with a bound field (field name on the form is BinNo) that goes back to the tblParts. I need to be able for the user to enter on the form the Bin number as it appears above. However at the moment it is dropping my decimal and is only keeping the 200200 portion of the Bin Number. If I enter the bin number correctly into the table it accepts the correct format of 200200.0100. Can someone take a look at the form and the field BinNo to tell me what I may have missed.
Keep in mind that the goal of the database is to enter the bin number into the form and run a query that creates a new table. There is also a delete table button since the data in the form will change for each blueprint document created.
I am attempting to attach a practice db for you to see what I have done but I have not had much success with this in the past. Thanks in advance for your help.

View 3 Replies View Related

Troubles Calculating Sum For Decimals

Jul 7, 2005

Hi everybody,

I have to calculate somme totals for decimal numbers, and... I can't make it to work.
I have a report:

Quantity Unit_price Price_without_Taxes Taxes Price
2 1,62 3,24 0,62 3,86
2 2,13 4,26 0,81 5,07
TI: 8,91

TI it's the sum of Price, and here is the problem, because the value of TI should be 8,93 Euro (3,86+5,07) not 8,91. In this case it's a loss of 3 cent , but in other cases, if i have more value to calculate the sum for I can loss a few euro!

The values are placed in the detail section, TI on the footer section of the report. To calculate TI I used a Text box wich format is currency, Decimal places 2, Control source =Sum([Price]).

I make this same calculations on forms also, there the situation it's worst, the value it's rounding down or up in each case, in this particular case insted of 8,93 I got 8,00.

What's wrong with it? I'm making mistakes somwhere?
Any help is apreciated. I need it soooooo bedly! :)

Thanx,
Attila

View 14 Replies View Related

Importing, Currency And Decimals

May 22, 2006

I'm having a problem getting imported data to display what I want. I'm importing a fixed width file and one of my fields is a currency amount. The field value in the file is 12 characters with the last 2 as the cents (000000544990) I have my access field type as currency with 2 decimals (and I've tried many other settings auto,0 etc.) When I do my import it displays my data as $544,990.00 If I tell it no decimals it displays $544,990 It should be displayed as $5,449.90 somehow it keeps adding 2 characters and uses them as the cents instead of using the last 2 from my file.

Any suggestions?

Thanks for helping me out.

Rick

View 9 Replies View Related

Whats Controlling These Decimals?

Jan 5, 2007

Hello,

Dont understand what is controlling these decimals. I dont need any decimals for this database. The currency is talking bout money in 1000's and the probability is whole numbers.

Here is where I cant get the decimals to stop:

http://img80.imageshack.us/img80/3685/untitled2pl2.png
http://img77.imageshack.us/img77/6276/untitled3pa6.png
http://img208.imageshack.us/img208/2047/untitled3lk8.png

I have tried different things but no luck...anyone have any suggestions.

Thanks.

View 10 Replies View Related

Setting Up Form To Allow Decimals

Mar 23, 2006

I need to have a field on my form to accept the user keying in the number in this fashion: 200200.1234 but as I currently have it set it accepts only the 200200 portion of this part number. I am a beginner so I am sure this is an easy question for some of the pros out there.

As a footnote the table design has the bin no. as data type - text and I added an input mask of 000000.0000;0; the field on the form is a combo box. Maybe that will make a clear picture for you.

Thanks in advance for your assistance.

View 5 Replies View Related

Specifying Number Of Decimals When Exporting Data

Oct 31, 2007

Hi,
I use the built in tools "Analyze data with excel to export" to export data from froms to excel and it works fine. The only problem is in the form and table I had specified 3 decimals but in excel the data is two decimals and I have to always reformat the cells manually to 3 decimals.

Any way to have this set when exporting even if I have to use VBA code.

Thank you.

View 2 Replies View Related

Query - Weird Decimals Return

Sep 7, 2005

I enter values into a table with 2 decimal places.

I have a query that applies percents to the values - I have set the results to have 2 decimal places.

I have another query that summarises data from the previous query, however the results I get are not right, the decimals differ from the actual result, if I make a sum of the values by hand.

It seems as if the query I have made to apply percents only DISPLAYS data with 2 decimals instead of actually rounding it, so that the other query summarises data with more than 2 decimals, and thats where the difference int the end result comes from. I don't know how to fix this however.

Can someone please help.

Thanks!

View 1 Replies View Related

Calculation....need To Drop The Decimals In The Result.

May 2, 2008

Here's what I have so far...and it works fine; however, some results have decimal places; i.e., 2.1666666.

I just need the result to be the whole number. I can't seem to get it to come out that way...I've used "round"...but I must not be putting it in the right part of the formula.

TEST: IIf(Year([EndTerm])>Year(Date()),0,IIf((Year(Date())-Year([EndTerm]))/[Renew]<1,1,(Year(Date())-Year([EndTerm]))/[Renew]))


Thank you for any help!
Carol

View 2 Replies View Related

Can't Get My Weight Field To Accept Decimals...???

Aug 14, 2005

I've got a products table in which I have a field called weight. Obviously, this is to hold the weight of the item. I've it set to Number | Long Integer with desimal places set to 2. However, when I put 2.5 it makes it 2.

What could be causing this?

View 1 Replies View Related

Enabling Decimals And Fractions In MS ACCESS

Feb 17, 2007

I am trying to develop a customized program in MS Access,
but one of the input parameters needs to be a decimal or
fraction (ie: I need to enter values that are not whole number
integers). Unfortunately, it seems that MS Access won't
enable me to input values that are not whole number integers.
I had this same difficulty in the past, and in that case, it turned out that the non-integer value was not used. But in
the current program I'm trying to develop, I definitely need
to get the non-integer data inputting to work, since the
parameter that I'm entering these values for is "percentage".
It turns out that if I enter a value from 0.51 to 1, it rounds
up to 100%, and if I enter a value that's 0.5 or lower, it rounds down to 0%. There is no in-between. I tried looking
into the various settings in DESIGN mode, but nothing seems
to correct this problem. Is there anyone out there reading
this that has insight into my problem? Could my version of
MS Access have a software corruption? Or is there just a
setting that I've overlooked? I appreciate any advice that
can be offered. Thanks for your help.

View 3 Replies View Related

Queries :: Set Decimals In Expression On Dates

Feb 19, 2014

Using Access 2007
Win 7

Total_Time: Format(nz(DateDiff("n",[Start],[End])/60))

This is my expression in a query.

I need to only show 2 decimal places in the results field.

View 6 Replies View Related

Can't Be In Two Places At Once

Nov 26, 2006

I have a database containing shipping details. As part of the error checking system I am trying to write a query that will identify if a ship is incorrectly recorded in two locations on the same day.

There are approx 50 ships and 60 locations all entered in one table in the following format:

Date, Ship, Location.

This is what I have got so far.
In (SELECT [Location] FROM [Ops_Log_Table] As Tmp GROUP BY [Location],[StartDate] HAVING Count(*)>1 And [StartDate] = [Ops_Log_Table].[StartDate])


This criteria finds 'Ship A' in 'Location 1' if it is entered more than once (which it is allowed to be).
What I am trying to find is 'Ship A' in 'Location 1' on the same date that 'Ship B' is there.

Thanks in advance,

Oscar

View 4 Replies View Related

Queries :: Formatting Whole Numbers And Decimals Differently

Nov 26, 2013

I want to print the results of a query where some values are whole numbers, some have 1 decimal place, some have 0.3333333 recurring etc. Problem is that in order to fit all the columns on a page the column width does not allow all the 0.33333... to display. So what I see is like this (there are lots of columns, I am just giving an example from one column)

891
833.5
######

I don't want to fix decimal places to 1 because then I would see 891.0 instead of 891. How can I format the number field so that whole numbers are shown without decimal place, numbers with 1 decimal place stay like that i.e. 833.5 is fine as it is. But display something like 313.666666666667 as 313.67 rather than ##### getting put in as not enough room for all the decimal numbers.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved