Results 1 to 9 of 9
  1. #1
    Altaful Haq is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2014
    Location
    Swat, KPK, Pakistan
    Posts
    22

    Multipling Values of two textboxs UPrice * Quantity

    i have a situtation where i have to multiply two values of text boxes where the UPrice value is 344 and its Quantity is 0.5 and put the result in the total

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Do calculations in query or in textbox. This calculation should be done when needed. The result should not be saved to table.
    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.

  3. #3
    Altaful Haq is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2014
    Location
    Swat, KPK, Pakistan
    Posts
    22
    But i want to save the result in table some time the customer want to buy half of the material from the factory. There are multiple product they buy half from the two of the product and used the for there need.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Saving calculated data is often a bad idea. But if you must, it requires code in some event to accomplish. Perhaps in the form BeforeUpdate event, VBA example:

    Me!fieldname = Me.textboxname
    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.

  5. #5
    Altaful Haq is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2014
    Location
    Swat, KPK, Pakistan
    Posts
    22
    When i put a value of (.5) or (0.5) it automatically converted into 0. what the reason behind it.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Are you saving that to an Integer type field?
    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.

  7. #7
    Altaful Haq is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2014
    Location
    Swat, KPK, Pakistan
    Posts
    22
    no the type is decimal

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Is this display of 0 in textbox on form or in table? Sounds like formatting is set for no decimals.
    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.

  9. #9
    Altaful Haq is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2014
    Location
    Swat, KPK, Pakistan
    Posts
    22
    Thanks i figure out the way of doing so. Thanks for Help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. duplicate a record if the quantity is >1
    By snipe in forum Programming
    Replies: 3
    Last Post: 04-21-2014, 09:56 AM
  2. Find quantity and seqnumber
    By mathanraj76 in forum Programming
    Replies: 4
    Last Post: 05-28-2013, 07:26 AM
  3. Add Quantity of Chemicals on Form
    By dlab85 in forum Forms
    Replies: 8
    Last Post: 03-12-2013, 09:06 AM
  4. Fill textboxs with data from a query
    By Bkgabbert in forum Queries
    Replies: 1
    Last Post: 05-25-2012, 04:09 AM
  5. products and quantity
    By woody in forum Forms
    Replies: 2
    Last Post: 02-06-2011, 11:58 PM

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