Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528

    How to hide decimals in the form field

    Hello Guys
    How to hide decimals in the form field
    For instance


    0.935
    935 but when it becomes a mathematical operations it will be 0.935
    But it appears in the form 935
    Click image for larger version. 

Name:	656565.JPG 
Views:	20 
Size:	24.6 KB 
ID:	15188

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If you know there will always be three positions past the decimal you can multiply the fraction part of the value by 1000 to get the result you want.

    There would have to be a specific set of rules in place to do this. You may need to write some code to determine if there is a whole value in the figure before you multiplied by 1000 and check other things also. You would need to be sure there are not more than three decimal places, for example.

    I would use an unbound textbox to display the calculated value. However, it looks as though you have a continuous form and an unbound textbox will not work in continuous view.

    You may have to create another column in your table and store the calculated value. Perhaps a calculated field in your table will work. You could name your new field something to indicate it is for viewing purposes and not to be used for other reasons.

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you
    No No. 1000
    The last number is 999
    And that this field is undergoing a math equation
    And do not aspire to write user 0.925
    I just want to write a number
    In the query is not considered 925 but considers 0.925

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Instead of a calculated field in a table you could create an alias in your query and do the math there in the query. This will work if the value is always three decimal places and no whole numbers.

  6. #6
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    In the future,
    How can I do the filter to these categories
    It is three to four digits only
    999
    900
    935
    925

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I don't understand what you mean when you say, "filter". You can use a combobox to select one of the values and then associate a subform to the selection.

    If you have three or four decimal places a general rule of multiplying by 1000 will not work.

  8. #8
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you
    Attach your database
    View the form Table1 Subform
    Attached Files Attached Files

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why is the data in the Purity field sometimes 0.925 and sometimes 925? Should be consistent with data entry and then will not have an issue. Could use ValidationRule to force input to be >= 0 or <=0, whichever you prefer.

    Otherwise, consider:

    IIf(InStr([purity], "."), [purity] * 1000, [purity])

    Should give calculated fields more meaningful names than Expr1, Expr2, etc.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much
    Yes, but I gave her the names of the form
    Open the form in Design
    It describes the column headers

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Regardless of captions in labels, field names are still Expr1, Expr2. I always change these default names to something informative.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    OK
    1. (Expr1) Is the price per gram * Quantity
    Where the quantity is (grams) 1000 grams = 1 kg
    2. (Expr2) Is the price of one gram - wage work
    That's where the wages of labor per gram and should be enacted, not dollars
    For example, for every one gram wage work (0.10) cents

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is your original question resolved with the expression I suggested?

    Do what you want about the field naming, was just a suggestion.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    The problem is
    If (purity)
    925 and 0.925 will not be there is an error in the total amount for the price of Gram
    For example, the price is 610 cents Gram and wage labor is .10 cents
    Output is 610.10 be a mistake
    Must be 620 cents
    What is the solution?
    Thank you for your cooperation Guys

  15. #15
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Try to delete the comma from 0.925
    Then type 925 and note
    Field (Price per gram with wages)
    The field (Price per gram without wages)

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. question|how to hide a field in form
    By mikichi in forum Access
    Replies: 5
    Last Post: 11-12-2013, 08:14 AM
  2. Export to .txt Issue: Field Returning 2 Decimals
    By SoSubaruMe in forum Import/Export Data
    Replies: 0
    Last Post: 02-27-2012, 09:09 AM
  3. Hide the content of a field
    By peter_lawton in forum Queries
    Replies: 6
    Last Post: 01-17-2012, 11:24 AM
  4. How do i open a form and hide a field?
    By xwnoob in forum Forms
    Replies: 1
    Last Post: 01-05-2012, 03:27 AM
  5. Hide Null field Line
    By brobb56 in forum Access
    Replies: 1
    Last Post: 09-26-2011, 11:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums