Fifo成本计算方法

编程入门 行业动态 更新时间:2024-10-23 11:25:43
本文介绍了Fifo成本计算方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

此讨论于2011年7月29日开始(Fifo和Lifo成本计算方法,FIFO确定,LIFO问题)。我是MS Access的新手,希望有人可以帮我提供 先生的表格/表格字段名称。 Larocque 代码。

This discussion was started back in July 29, 2011 (Fifo and Lifo costing method, FIFO ok, LIFO problem). I am new to MS Access and was hoping someone could help me with the table / form field names from Mr. Larocque code.

以下是代码:

Option Compare Database Public Sub CalculateFifoStock() Dim cn As ADODB.Connection Dim Rs1 As ADODB.Recordset Dim Rs2 As ADODB.Recordset Dim Prid As Long Dim iTot As Long Prid = 0 iTot = 0 DelFifo ' check sub procedure below Set cn = CurrentProject.Connection Set Rs1 = New ADODB.Recordset Set Rs2 = New ADODB.Recordset Rs1.Open "zxFifo", cn, adOpenForwardOnly, adLockReadOnly Rs2.Open "FifoStock", cn, adOpenDynamic, adLockOptimistic Do While Not Rs1.EOF If Rs1![prd] = Prid Then iTot = iTot + Rs1![pr] Else Prid = Rs1![prd] iTot = Rs1![pr] End If If iTot <= Rs1!sold Then Else 'if total quantity purchased does not exceed consumed Rs2.AddNew ' *********************** Assign purchase details Rs2!fdate = Rs1!xdate Rs2!doc = Rs1!doct Rs2!prdt = Rs1!prd Rs2!PQty = Rs1!pr Rs2!RQty = iTot Rs2!Rt = Rs1!Pp ' *********************** Assign available quantity If iTot - Rs1!sold > Rs1!pr Then Rs2!avQty = Rs1!pr Else Rs2!avQty = iTot - Rs1!sold End If ' *********************** Rs2.Update End If Rs1.MoveNext Loop Rs1.Close Rs2.Close cn.Close Set Rs1 = Nothing Set Rs2 = Nothing Set cn = Nothing End Sub Private Sub DelFifo() CurrentDb.Execute "delete * from fifoStock", dbFailOnError ' to empty table before new insertion End Sub

推荐答案

你好Bradyman

Hi Bradyman

你的问题有点模糊。

You question is a little vague.

RecordSets Rs1和Rs2来自一个名为 " zxFifo"和 FifoStock" 。

The RecordSets Rs1 and Rs2 come from a tables or queries named"zxFifo" and "FifoStock"respectively.

字段名称前面加上"!"。 ,so Rs1!xdate 指表/查询zxFifo和字段xdate。

The Field names are listed preceeded by a"!" , soRs1!xdateRefers to Table/Query zxFifo and field xdate.

更多推荐

Fifo成本计算方法

本文发布于:2023-11-22 05:34:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616161.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计算方法   成本   Fifo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!