Rss & SiteMap

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

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

标题:保存到表的问题

1楼
hongye 发表于:2025/1/20 11:25:00

Dim ter() As String = {"面料名称", "面料规格", "面料颜色", "面料门幅", "面料单位", "面料单耗", "面料合计", "供应商"}
For m1 As Integer = 1 To 9
    For y As Integer = 0 To ter.Length - 1
        If Forms("订单主表").ExistControl("Tml_" & m1 & "_" & y + 1) = True Then
            Dim drm As String = Forms("订单主表").Controls("Tml_" & m1 & "_" & y + 1).text
            If drm <> "" Then
                Dim Tea() As String = {"合同号", "款号"}
                Dim r As DataRow = ddm.AddNew
                For Each TTL As String In Tea
                    r(TTL) = Forms("订单主表").Controls(TTL).text
                    r(ter(y)) = Forms("订单主表").Controls("Tml_" & m1 & "_" & y + 1).Value
                Next
            End If
        End If
    Next
Next

不知道为什么,要求是每增加一行填入每一列的数据,现在是每一列数据增加一行,由于是动态增加的控件,不会搞了,求帮助

2楼
有点蓝 发表于:2025/1/20 11:30:00
请截图说明一下
3楼
hongye 发表于:2025/1/20 12:40:00


图片点击可在新窗口打开查看此主题相关图片如下:提问图片1.jpg
图片点击可在新窗口打开查看

 


图片点击可在新窗口打开查看此主题相关图片如下:提问图片3.jpg
图片点击可在新窗口打开查看

 

在数据库的数据变每行只有一个数据了,应该是 每行的数据是像第一张表格一样的

4楼
有点蓝 发表于:2025/1/20 13:38:00
控件是怎么样放的
5楼
有点蓝 发表于:2025/1/20 13:46:00

Dim ter() As String = {"面料名称", "面料规格", "面料颜色", "面料门幅", "面料单位", "面料单耗", "面料合计", "供应商"}
For m1 As Integer = 1 To 9

If Forms("订单主表").ExistControl("Tml_" & m1 & "_1") = True Then

Dim r As DataRow = ddm.AddNew
    For y As Integer = 0 To ter.Length - 1
            Dim drm As String = Forms("订单主表").Controls("Tml_" & m1 & "_" & y + 1).text
            If drm <> "" Then
                Dim Tea() As String = {"合同号", "款号"}

For Each TTL As String In Tea
                ……

6楼
hongye 发表于:2025/1/20 17:00:00

If _UserGr oup = "办公室" Or Tables("订单查询_订单表").Current("业务担当") = _Username Or _Username = "开发者"  Then
    If MessageBox.Show("是否要删除该订单?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
        Dim rr As Row = Tables("订单查询_订单表").Current
        Dim filter As String = "合同号 = '" & rr("合同号") & "' And 款号 = '" & rr("款号") & "'"
        Dim filters As String = "合同号 = '" & rr("合同号") & "'And 款号 = '" &  rr("款号") & "' And 业务担当 = '" & rr("业务担当") & "' And 合同交期 = '" & rr("合同交期") & "' And 客户名称 = '" & rr("客户名称") & "' And 品名 = '" & rr("品名") & "' And 合同数量 = '" & rr("合同数量") & "' "
        Dim cmd As New SQ LCom mand
        Dim cmb As WinFor m.ComboBox
        cmd.C
        cmd.CommandText = "del ete Fro m {订单主表} where " & filters
        cmd.ExecuteNonQuery
        cmd.CommandText = "delet e Fro m {订单数量明细} where " & filter
        cmd.ExecuteNonQuery
        cmd.CommandText = "dele te Fro m {配色表}where " & filter
        cmd.ExecuteNonQuery
        cmd.CommandText = "delete Fro m {订单辅料明细}where " & filter
        cmd.ExecuteNonQuery
        cmd.CommandText = "delete Fro m {订单面料明细}where " & filter
        cmd.ExecuteNonQuery
        cmd.CommandText = "delete Fr om {面料委托表}where " & filter
        cmd.ExecuteNonQuery
        CurrentTable.Current.Delete()
        If DataTables("订单查询_订单表").HasChanges Then
            If MessageBox.Show("订单已经被修改,是否保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
                MessageBox.Show("提示 OK")
                CurrentTable.Save()
                MessageBox.Show(2)
            End If
        End If
        MessageBox.Show(3)
    End If
    MessageBox.Show(4)
Else
    MessageBox.Show("已生成的订单,只能担当本人或经理才能删除!", "提示")
    e.Cancel = True
End If

 

 


图片点击可在新窗口打开查看此主题相关图片如下:提问图片3.jpg
图片点击可在新窗口打开查看

 

 

这是为什么?

7楼
有点蓝 发表于:2025/1/20 17:14:00
DataTables("订单查询_订单表").Save
8楼
hongye 发表于:2025/1/20 17:34:00
还是这个问题
9楼
有点蓝 发表于:2025/1/20 17:40:00
代码在什么事件里?
10楼
hongye 发表于:2025/1/20 17:43:00

按键里

 

共11 条记录, 每页显示 10 条, 页签: [1] [2]

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

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