Foxtable(狐表)用户栏目专家坐堂 → [求助]关于遍历保存的问题


  共有3014人关注过本帖树形打印复制链接

主题:[求助]关于遍历保存的问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/8/11 15:41:00 [显示全部帖子]

Dim flag As Boolean = True
With Tables("表A")
    If .Rows.count > 0 Then
        Dim Result As DialogResult
        Result = MessageBox.Show("是否确定保存表A?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If Result = DialogResult.Yes Then
            For Each r As Row In Tables("表A")
                If r("字段1") = Nothing  Then
                    Messagebox.show("请选择字段1!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                    flag = False
                    Exit For
                ElseIf r("字段2") = Nothing  Then
                    Messagebox.show("请选择字段2!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                    flag = False
                    Exit For
                End If
            Next
            If flag Then
                For i As Integer = 0 To .Rows.count - 1
                    .Rows(i).Locked = True
                    .Rows(i).Save
                Next
                Messagebox.show("表A已保存!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)               
            End If
        Else
            Messagebox.show("请继续!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        End If
    Else
        Messagebox.show("当前表无数据,保存无效!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End With

 回到顶部