如何根据现有记录添加记录 [英] How to add a Record Based on Existing Record

查看:109
本文介绍了如何根据现有记录添加记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在开发一个库存控制软件。 Iam卡在某个地方。

我有一个表格添加新股票由组合框,文本框等组成,用于在表格中添加记录。


我有另一种表格,其中包含添加类似字样。按钮。


我用来存储记录的表包含一个字段调用添加更多数量。如果用户在此字段中输入任何记录的任何数值,请单击添加类似于按钮。按钮然后相同添加新股票表单应打开,并在表单中的相应控件中预先填充所有记录。添加新股票表格还包含数量表格。领域。所以用户在添加更多数量中输入的值现在应显示在数量中现在。



现在,这将允许用户根据现有记录添加另一条记录,并在数量字段中添加新值。

点击添加类似于按钮,添加新股票按钮表格不应该在编辑模式下打开,而应该在添加模式下打开。


我是初学者,不知道这样做。

有人可以帮助我,因为它非常紧急。


谢谢

Prashant

解决方案

AddSimilar的点击事件代码将如下所示

展开 | 选择 | Wrap | 行号


非常感谢它的工作

刚发现一个问题。

如果单击添加类似按钮然后它第一次工作正常。但是如果你没有添加记录而是点击关闭按钮并再次点击添加类似于按钮,那么它总是打开添加新股票按钮。从第一行子表单tblStock_Inventory_subform填充记录的表单而不是dblQuantity_Of_Stock_To_Check_Out所针对的那一行是null


这是addimilar按钮的代码:

展开 | 选择 | Wrap | 行号


Hi,
I am developing a stock control software. Iam stuck somewhere.
I have a form "Add new stock" consisting of combobox, text boxes etc. which is used to add records in a table.

I have another form which has "Add Similar To" button.

The table which i used to store records contains a field call "Add More Quantity". If a user enters any numerical value in this field against any record and click on "Add Similar To" button then same "Add New Stock" form should open with all the records pre-populated in corresponding controls in the form. Add New Stock form also contain "Quantity" Field. so the value which user has entered in "Add More Quantity" should now be displayed in "Quantity" field.



Now this will allow user to add another record based on existing record with new values in quantity field.
On clicking ''Add Similar to'' button, the "Add New Stock" Form should not open in Edit mode rather it should open in Add mode.

I am a beginner and don''t have any idea to do this.

Can someone please help me as its very urgent.

Thanks
Prashant

解决方案

Your click event code for AddSimilar will look something like this

Expand|Select|Wrap|Line Numbers


Thanks a lot it worked


Just found one issue with this.
If you click Add similar button then its working fine for first time. But if you don''t add the record rather click on ''Close'' button and again click on ''Add Similar to'' button then it always opens "Add New Stock" form with populating record from the first row of subform "tblStock_Inventory_subform" and not that row against which "dblQuantity_Of_Stock_To_Check_Out" is null

Here is the code for addsimilar button:

Expand|Select|Wrap|Line Numbers


这篇关于如何根据现有记录添加记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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