以我的形式存储的代码 [英] code for storage in my form

查看:59
本文介绍了以我的形式存储的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 8.0中有一个表单.在我的表格中,我有
两个文本字段(ID,金额),
一个按钮(命令).我在Access中有一个表(Items),其中有两个Field
身份证和金额,并有两个记录. ID中的第一个记录为1,数量为40.第二个记录的ID为2,数量为100.
当我在文本字段(ID)中输入1在文本字段中(数量)为20,然后按按钮顺序时.
我希望将其与表中保存的ID为1的先前金额相加.如果ID为1的先前金额为40
那么保存后的结果必须是60.

当我在文本字段(ID)中输入2在文本字段(金额)中输入200,然后按按钮顺序.
我希望将其与表中保存的ID为2的先前金额相加.如果ID为1的先前金额为100
那么保存后的结果必须为300.

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.

推荐答案

这是相当基本的编程.使用文本字段中的ID字段来读取数据库记录.从第二个文本字段中提取金额并将其添加到总计中,然后将记录写回到数据库中.
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.


这篇关于以我的形式存储的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆