Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form in visual studio 8.0. In my form I have
two text field(ID,amount),
a button(Order). I have a table(Items) in Ms.Access having two Field
ID and amount and having two records. First record 1 in ID and 40 in amount. second record 2 in ID and 100 in amount.
when I Enter 1 in text Field (ID) 20 in text Field (amount), and then press button order.
I want it to be added with the previous Amount that have ID 1 Saved in the table.Means If previous amount that have ID 1 is 40
then the result after saving must be 60.

when I Enter 2 in text Field (ID) 200 in text Field (amount), and then press button order.
I want it to be added with the previous Amount that have ID 2 Saved in the table.Means If previous amount that have ID 1 is 100
then the result after saving must be 300.
Posted

1 solution

This is a fairly basic piece of programming. Use the ID field from the text field to read your database record. Take the amount from the second text field and add it to the total and write the record back to the database.
 
Share this answer
 
Comments
sokkong 20-Jul-11 23:51pm    
do u have any code of this?
Richard MacCutchan 21-Jul-11 4:04am    
If you cannot figure this out and write the code for yourself, or use Google to find a sample that you can modify to your requirements, then you really need to consider whether this is the right career path for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900