从表格中删除表格上的字段中的数字 [英] deducting a number in a field on a form from a table

查看:85
本文介绍了从表格中删除表格上的字段中的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个餐厅用餐订购系统。我对VB代码不是很了解,但我慢慢得到了它。我希望能够将订单中所要求的膳食数量输入到frmOrderDetails(frmOrder的子表格)中,并且该数字将从tblMeal中的库存数量中扣除,我不知道该如何去关于它?

I am creating a restaurant meal ordering system. I am not very good with VB code, but am getting the hang of it slowly. I want to be able to enter the number of meals requested as part of an order onto frmOrderDetails ( the subform of frmOrder ) and that number to be deducted from the number of that meal in stock in the tblMeal, and am not sure how to go about it?

推荐答案

这取决于你想用这个号码做什么。您是否尝试将其存储在表格中?
That depends on what you want to do with that number. Are you trying to store it in a table?


''项目数''存储在''tblOrderDetails''''(项目)中in stock''存储在''tblItems''中。使用''frmOrderDetails''我想输入''Number of Items''和要从''库存中的(项目)的数量中减去的数字。


我用的是 Items 而不是 Meals ,因为它还包括饮料。


我不知道我是否说得很清楚,但这是针对特定的一餐 - 而不是订单中的所有餐点。
''Number of Items'' is stored in ''tblOrderDetails'' ''Number of (Items) in Stock'' is stored in ''tblItems''. Using ''frmOrderDetails'' I want to input the ''Number of Items'' and that number to be subtracted from ''Number of (Items) in Stock'' .

I''m using the word Items instead of Meals, because it also includes drinks.

I dont know whether I''ve made it clear but this is for a particular meal- not a total of all meals in the order.


我是假设您有一个项目ID字段,并且表格在该字段上链接?然后,您可以运行更新查询。
I''m assuming you have an Item ID field and that the tables are linked on that field? You can then run an update query.


这篇关于从表格中删除表格上的字段中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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