Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共8 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:自动生成工序号问题

1楼
lgz518 发表于:2025/2/7 19:41:00
主表与明细表关联,下面代码如何改?

if e.datacol.name = "工序" then
dim idx as integer = tables("明细表").finrow(e.datarow)
if idx = 0 then
e.datarow("工序号") = 1
else
dim r as row = tables("明细表").rows(idx- 1)
if r("工序") = e.datarow("工序") then
e.datarow("工序号") = r("工序号")
else
e.datarow("工序号") = r("工序号") + 1
end if
end if
end if
2楼
有点蓝 发表于:2025/2/8 8:54:00
数据是怎么样的?要实现什么功能?代码在哪个表的什么事件?执行有什么问题?
[此贴子已经被作者于2025/2/8 8:54:32编辑过]
3楼
lgz518 发表于:2025/2/8 10:04:00
代码在明细表,需求的功能,主表新增后,明细表新增后生成序号,类似狐表的表序号
4楼
有点蓝 发表于:2025/2/8 10:23:00
代码执行有什么问题?
5楼
lgz518 发表于:2025/2/8 10:47:00

图片点击可在新窗口打开查看此主题相关图片如下:工序号.jpg
图片点击可在新窗口打开查看
6楼
有点蓝 发表于:2025/2/8 10:58:00
If e.DataCol.name = "工序" Then
    Dim dr As DataRow = e.DataTable.find("编号='" & e.DataRow("编号") & "' and 工序='" & e.DataRow("工序") & "' and _identiify<>" & e.DataRow("_identiify"))
    If dr IsNot Nothing Then
        e.DataRow("工序号") = dr("工序号")
    Else
        Dim max As Integer = e.DataTable.compute("max(工序号)", "编号='" & e.DataRow("编号") & "' and _identiify<>" & e.DataRow("_identiify"))
        e.DataRow("工序号") = max + 1
    End If
End If
7楼
lgz518 发表于:2025/2/8 11:34:00
执行报错:列“_identiify”不属于表 明细表
8楼
有点蓝 发表于:2025/2/8 11:38:00
多个字母,自行改改
共8 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.