Results 1 to 14 of 14
  1. #1
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21

    Oat-so-simple but i dont have a clue

    K im going to sound really silly now but i just cant figure it out.



    I have a text box on my form called Quantity and it get its data automatically inputted from a combo box also on the form.

    I then have another text box called Quantity_In that the user inputs a number. this hasnt had any configuring at all

    Last but not least i have another text box called New Quantity which i have put a calculation in the control source in order to add the Quantity to the Quantity_In.

    Now you would of thought this is simple right, it would work...

    BUT!! ITS NOT! instead of adding the values its adding the number that the user inputs onto the end of the number that shows in Quantity. E.g. if the Quantity was 24 and the user added 2 it is showing in New Quantity as 242 instead of 26

    The calculation that is in New Quantity control source is: =[Quantity]+[Quantity_In]



    Please help!!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It is concantenating strings together.

  3. #3
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21
    Hey i dont actually know what that mean?? :S can you explain simpler please?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I suspect the [Quantity] and [Quantity_In] fields are Text fields and not numeric fields.

  5. #5
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21
    Yes thats correct

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    From their names I would say they should be changed to Numeric fields. Then your formula will start working as well.

  7. #7
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21
    Can you guide me in how to do this please?

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does this db have live data in it? Did you design it?

  9. #9
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21
    Yes i designed it and its not live within the company its for m just developing it atm

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Good. You can just go into the table in design mode and change the field to a numeric data type. If you will never need decimals then use either Integer or Long. If you will be needing decimals and 4 decimal places is good enough then use a Currency data type otherwise use the floating point Single or Double depending on your needs.

  11. #11
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21
    but the text fields [Quantity_In] and [New Quantity] are not in my table and the problem lies int the [New Quantity] field

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In post #5 of this thread you said they *were* text fields. I'm confused. What are the fields in your table?

  13. #13
    turbo910 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    21
    Basically i have a table (Product_tbl) with the following fields:
    • Product_ID
    • Product_Name
    • Product_Qua
    • Unit
    • Section
    and on the form i have added the text boxes Qunatity_In and New Quantity Unbound

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Put your calculations in the AfterUpdate events of both of the other two controls instead of the control source of the answer control.

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

Similar Threads

  1. Simple question
    By KenM in forum Queries
    Replies: 1
    Last Post: 11-10-2009, 03:32 PM
  2. Simple question?
    By roads.zx in forum Access
    Replies: 0
    Last Post: 10-15-2009, 04:56 PM
  3. simple query
    By taylorosso in forum Queries
    Replies: 1
    Last Post: 10-06-2009, 04:26 AM
  4. Criteria from Combobox dont work.
    By Ryan in forum Queries
    Replies: 3
    Last Post: 08-31-2009, 07:09 AM
  5. 1st Access application. Needs a clue..
    By Icedog in forum Access
    Replies: 3
    Last Post: 09-24-2008, 09:38 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