通过双击将键或值从一个子表单传递到另一个子表单 [英] passing keys or values from one subform to another by double clicking

查看:67
本文介绍了通过双击将键或值从一个子表单传递到另一个子表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找解决问题的方法,该问题简化了我的数据库的重复信息输入


基本结构是订单tbl主表单和pricing_tbl子表单,当订单有定期定价时第三结构,查询位置和产品的定价历史,然后从过滤列表中选择合适的成本计算方法。这个历史数据表(子表单2)将是用于填充成本核算的可选方法。


我已经在联结表中运行作为解决方案但如果有人更改了历史成本计算方法,它可能会导致问题。另一种说法是,如果我链接到与给定客户或客户相关的历史记录,则可能所有与该定价方法相关的客户都会发生变化。


定价基于基础组件(材料)70%30%B实际单价基于每月变化的市场指数。


理想情况下我想查看新记录(订单)在主表格上。查询或过滤该工厂(炼油厂)和产品的成本核算方法。单击或双击上面的定价方法并传递序列号(类似于连接方法)或将component_A,component_A_Percent,component_B,component_b_percent等传递给子窗体1,这是您手动输入此信息的位置。


通常我可以弄清楚VBA,但我并不擅长它。我找到Cold Fusion简化器,因为我不必处理视觉方法。一个简单的例子或一般方向将不胜感激。


这是我从双击中存储价值的微弱尝试


Private Sub Form_DblClick(取消为整数)

Dim price_seq As Integer

Me.RecordSource =" standard_pricing_tbl"

Me.intSequence.ControlSource =" Pricing_method_seq"

price_seq = Pricing_Method_Seq

End Sub


MP

I have searched forever trying to solve a problem that simplifies recurring info inputs to my database

the basic structure is Orders tbl main form and pricing_tbl subform and third when orders have recurring pricing structure, query pricing history for location and product, then select appropriate costing method from filtered list. This historical data sheet (subform 2) would be optional method for populating costing.

I have run across junction tables as a solution but it could potential cause problems if someone changes the historical costing methods. another way of saying this is that if I''m linked to a historical record associated with a given customer or customers then potentially all customers associated with that pricing method change.

pricing is based on base components (materials) 70% a 30% B the actual unit price is based on market indexes which change monthly.

Ideally I would like to be looking at new record (order) on the main form. Query or filter for costing methods for that plant (refinery) and product. Click or double click on the above pricing method and pass the sequence number (similar to junction method) or pass component_A, component_A_Percent, component_B, component_b_percent, etc. to subform 1 which is where you manually enter this information.

Usually I can figure out VBA but am not particulary adept with it. I find Cold Fusion simplifier because I don''t have to deal with visual methods. A simple example or general direction would be greatly appreciated.

Here is my feeble attempt to store a value from the double click

Private Sub Form_DblClick(Cancel As Integer)
Dim price_seq As Integer
Me.RecordSource = "standard_pricing_tbl"
Me.intSequence.ControlSource = "Pricing_method_seq"
price_seq = Pricing_Method_Seq
End Sub

MP

推荐答案

嗯,复杂的描述。我想你正在描述我们称之为物料清单的东西。 (BOM)成本计算方法。

这需要递归。使用产品结构和成本进行编程。

构建这样的(基本上是树)结构需要测试每个分支不要保持相同的产品,因为这将创建一个无限的产品。循环。


您是如何组织产品表以启用产品之间的关系的?


Nic; o)
Hmm, complex description. I guess you''re describing what we call a "Bill Of Materials" (BOM) costing method.
This requires "recursive" programming using the product structure and the costs.
Building such a (basically a tree-) structure requires testing each branch not to hold the same products, as that will create an "endless" loop.

How did you organize your Product table to enable the relation between the products ?

Nic;o)


只是为了给一些清晰度


有一个订单表主键订购商品


转账成本是内部成本或者内部价格与订单表有一对一的关系


我应该提到的一件事是,从来没有或很少有两个以上的组件。因此一对一。我希望一对多地使其更灵活,但这种情况应该是可以接受的。


历史定价方法只是工厂的一个独特子集,它有一个产品定价方法自动编号字段提供唯一标识符


最终我将计算出的价格更新到订单表以确保静态价格


我还没有找到最简单的方法,并意识到这有点笨拙


我的问题通常是理解对象,状态,关注和引用它们。


我做了提出了一种替代方法,其中包括为过滤的历史定价方法添加复选框字段。通过参数化订单商品将已检查记录的记录值返回到表单,将其与附加查询中的定价组件相结合。


然后我将表单重新加载到该记录中定价方法会显示在哪里手动输入。


再次引用表单中的订单项来构建查询以及如何将表单重新加载到以前的状态加上定价方法尚未完成。我已经使用Access进行了很多工作,但没有太多的自动化或表单使用。


如果我听起来很模糊,我道歉。试图简化为标准数据库表名称,而实际表格不是订单或订单详细信息。我无法看到我第一次写的内容,也不知道你在这个回复画面上说了什么。


BOM通常是正确的,但由于操作订单明细是项目级别。它是组成订单商品的商品。为混乱道歉; )。对我来说也是一个学习曲线。 SAP没有正确处理这个问题所以我正在创建一个双重输入方法,但是尝试在准确无误的情况下使用SAP,并允许用户以最小的努力创建月度P& L.每月约有108个订单项目和额外的详细信息,所以放入一个月是繁重的。


感谢您的回复
Just to give some clarity

there is an orders table primary keys order item

transfer cost which is internal cost or internal price has a one to one relation to the orders table

One thing I should have mentioned is that there are never or rarely more than two components. Therefore one to one. I would have liked to make it more flexible with one to many but this case it should be acceptable.

historical pricing methods is just a unique subset of plant, product pricing methods it has an autonumber field providing a unique identifier

Ultimately i update the calculated price to the orders table to ensure a static price

I have yet to find the simplest method and realize this is a little clunky

My problem is generally understanding objects, states, focus and referencing them.

I did come up with an alternative method which involves adding a checkbox field to filtered historical pricing methods. returning the record value of the checked record to form by parameterizing the order item, combining it with the pricing components in an append query.

Then i would reload the form to that record and the pricing method would show up where it would be manually entered.


Again referencing the order item from the form to build the query and how I reload the form to previous state plus the pricing methods is yet to be accomplished. I have worked a lot with Access but not much automation or form usage.

I apologize if I sound vague. Tried to simplify to standard database table names while the actual tables aren''t orders or order details. I can''t see what I wrote the first time nor exactly what you said from this reply screen.

BOM is generally correct, though since the operative order detail is item level. It is the items that compose the order item. Apologize for the confusion ; ). Been a learning curve for me as well. SAP doesn''t handle this correctly so I am creating a double entry method but trying to use SAP where it is accurate and allow a user to create a monthly P&L with minimal effort. There are about 108 order items a month and additional details so putting in one month was onerous.

thanks for the response


嗯,还有一些难以理解所涉及的过程。

您的初始问题很容易实现,只需将值存储在绑定中即可。当您关闭表单时,字段将导致Access存储该值。

存储最终计算价格是基本值(如价格)随时间变化的方式。除此之外,您可以选择以开始(和/或结束)日期存储价格。这将使结果可验证,但更难确定价格,因为需要提取日期。


确定子表单中的值与您的附加复选框字段相当容易通过对YesNo字段设置为true的行执行求和来实现。为此,可以创建一个引用包含唯一ID的表单字段的查询。


使用不同计算方法的部分更难。我得到的印象是用户可以选择不同的项目,并且您的表单会添加它们,我错过了真实的BOM属性,因为项目可以链接到其他(较低)项目,因此是不同的级别。


Nic; o)
Hmm, still some trouble to understand the processes involved.
Your initial question is rather easy to achieve as just storing the value in a "bound" field will cause Access to store the value when you close the form.
Storing the final calculated price is the way to go when the basic values (like the prices) are changing overtime. Alternatively to this you could chose for storing the prices with a start- (and/or end-) date. This will make the result verifyable, but harder to determine the price as a date is needed to extract it.

The determination of the values in subforms is with your additional checkbox field rather easy to achieve by doing a Sum on the rows having a YesNo field set to true. For this a query can be created referencing the formfield holding the Unique ID.

More difficult is the part with the different calculation methods. I get the impression the user can select the different items and your form adds them, I''m missing the real BOM property, being the different levels as items can be linked to other ("lower") items.

Nic;o)


这篇关于通过双击将键或值从一个子表单传递到另一个子表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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