如何将表单(列表框)中的记录添加到单独的表单子表单中? [英] How do I add records from a form (listbox) to a separate forms subform?

查看:66
本文介绍了如何将表单(列表框)中的记录添加到单独的表单子表单中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这可能是我对这个项目的最终''问题'....!


我需要将产品添加到报价/销售点表格中。我的产品列在我主表单上的列表框中(frmMain) - 当我点击Add To Basket时,我需要将产品添加到Quote表单的子表单中(frmQuotation)。


此外,我需要代码来识别它是否是第一个产品。


我目前所拥有的是报价单上的员工编号字段,如果它是'notNull''那么子表单中已存在一条记录,因此子表单直接获得焦点,使产品能够从主表单发送...

这就是我所附的到我的添加到购物篮点击事件...

I think this may be my final ''issue'' with this project....!

I need to add products to a quotation/point of sale form. My products are listed in a listbox on my main form (frmMain) - when I click Add To Basket I need the product to be added to the subform of the Quote form (frmQuotation).

Additionally, I need for the code to recognise whether it is the FIRST product or not.

What I have at the moment is an Employee No. field on the quotation form that if it is ''notNull'' then a record already exists in the subform and therefore the subform gets the focus directly, enabling products to be sent over from the main form...
This is what I have attached to my Add To Basket click event...

展开 | 选择 | Wrap | 行号

推荐答案

对不起 - 请注意,输入框是我尝试的最新方法,用于区分添加到报价中的第一个产品和以下任何产品(显然不需要员工编号)。


再次感谢,


Stonward
Sorry - please note that the Inputbox is a recent method I tried in order to distinguish between the first product added to the quote, and any following products (where Employee No would obviously not be needed).

Thanks again,

Stonward


此问题中代码的问题在于我们不知道问题是什么它编译?它崩溃了吗?它会给你一个不同的结果吗?


我无法理解这个问题。有时候我可以在各行之间阅读,但是这里有太少的东西可以继续下去。
The problem with your code in this question is that we don''t know what the problem is. Does it compile? Does it crash? Does it give a different result from what you expect?

I can''t understand the question well. Sometimes I can read between the lines, but there is too little to go on here that makes sense.


试过本地人和debug.print / stepping?我也没有看到gstrwheretyre被宣布?得到明确的选项?它是一个子表单吗?那你为什么试着打开呢?


编辑。我想我明白了问题所在。你的双引号不是引用,而是其他一些字符。在CurrentProject.AllForms(" frm1")(我在这些中使用了正确的。这就是为什么你应该强迫自己使用Option Explicit。所以你知道你的vars;)
Tried locals and debug.print / stepping? Also I didn''t see gstrwheretyre get declared? Got Option Explicit on? And is it a subform? Then why do you try to open it?

Edit. I think I see what the problem is. Your double quotes aren''t quotes but some other char. At CurrentProject.AllForms("frm1") (I used the correct one in these. Thats why u rlly should force yourself to use Option Explicit. So you know ur vars ;)


这篇关于如何将表单(列表框)中的记录添加到单独的表单子表单中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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