以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  语法错误:“&”运算符前缺少操作数  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=121617)

--  作者:蓝蚂蚁
--  发布时间:2018/7/10 15:25:00
--  语法错误:“&”运算符前缺少操作数

有下面一段代码,在操作时提示:语法错误:“&”运算符前缺少操作数,不知道哪处有问题,烦劳老师帮忙改一下。

If e.DataCol.Name = "配送公司_名称" Then

    Dim Result As DialogResult

    Dim gs As String=e.NewValue

    If gs = Nothing Then

        MessageBox.Show("没有选中配送公司!", "提示")

    Else

        Dim zz As DataRow =DataTables("配送公司资质").Find( gs & "= \'有\' And 分类目录编号=\'" & e.DataRow("医疗器械分类目录代码") & "\'")

        If zz IsNot Nothing Then

            MessageBox.Show(""& gs &" 有配送资质,可以配送!", "提示")

            e.DataRow("配送公司_名称")=" & e.NewValue & "

        Else

            Result=MessageBox.Show(""& gs &" 无配送资质,确定由它配送吗?", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question)

            If Result = DialogResult.No Then

                e.Cancel = True

            Else

                e.DataRow("配送公司_名称")="& e.NewValue & "

            End If

        End If

    End If

End If


--  作者:有点甜
--  发布时间:2018/7/10 15:52:00
--  

If e.DataCol.Name = "配送公司_名称" Then

    Dim Result As DialogResult

    Dim gs As String=e.NewValue

    If gs = Nothing Then

        MessageBox.Show("没有选中配送公司!", "提示")

    Else

        Dim zz As DataRow =DataTables("配送公司资质").Find( gs & "= \'有\' And 分类目录编号=\'" & e.DataRow("医疗器械分类目录代码") & "\'")

        If zz IsNot Nothing Then

            MessageBox.Show(gs &" 有配送资质,可以配送!", "提示")

            e.DataRow("配送公司_名称")=e.NewValue

        Else

            Result=MessageBox.Show(gs &" 无配送资质,确定由它配送吗?", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question)

            If Result = DialogResult.No Then

                e.Cancel = True

            Else

                e.DataRow("配送公司_名称")=e.NewValue

            End If

        End If

    End If

End If


--  作者:蓝蚂蚁
--  发布时间:2018/7/10 16:34:00
--  

If e.DataCol.Name = "配送公司_名称" Then

    Dim Result As DialogResult

    Dim gs As String=e.NewValue

    If gs = Nothing Then

        MessageBox.Show("没有选中配送公司!", "提示")

    Else

        Dim zz As DataRow =DataTables("配送公司资质").Find( gs & "= \'有\' And 分类目录编号=\'" & e.DataRow("医疗器械分类目录代码") & "\'")

        If zz IsNot Nothing Then

            MessageBox.Show(gs &" 有配送资质,可以配送!", "提示")  【在这个提示窗口中,点击确定按钮 ,不能把这个窗口关闭,只能强制关闭项目】

            e.DataRow("配送公司_名称")=e.NewValue

        Else

            Result=MessageBox.Show(gs &" 无配送资质,确定由它配送吗?", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question)

            If Result = DialogResult.No Then

                e.Cancel = True

            Else

                e.DataRow("配送公司_名称")=e.NewValue  【在这个提示窗口中,点击确定按钮 ,也不能把这个窗口关闭,要关闭这个窗口只能点击“否“】

            End If

        End If

    End If

End If


--  作者:有点甜
--  发布时间:2018/7/10 16:40:00
--  

这个代码删除(两个地方)

 

e.DataRow("配送公司_名称")=e.NewValue


--  作者:蓝蚂蚁
--  发布时间:2018/7/10 16:44:00
--  
完美解决 万分感谢