以文本方式查看主题

-  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=100364)

--  作者:xusuyang
--  发布时间:2017/5/10 13:58:00
--  请老师纠正

 老师!请帮查找一下

If e.DataCol.Name = "产品名称" Then

    If e.DataRow.IsNull("产品名称") Then

        e.DataRow("产品编码") = Nothing

    Else

        e.DataRow("产品编码") = GetPy(e.DataRow("产品名称"), 1)

    End If

End If

If e.DataCol.Name = "订货日期" Then

    If e.DataRow.IsNull("订货日期") Then

        e.DataRow("产品编码") = Nothing

    Else

        Dim bh As String = e.DataRow("产品编码") & Format(cdate(e.DataRow("订货日期")),"yyyyMMdd")

 

   

        If e.DataRow("订货编码").StartsWith(bh) = False

            Dim max As String

            Dim idx As Integer

    If e.DataRow.IsNull("产品编码") Then

max = e.DataTable.Compute("Max(订货编码)","产品编码 is null And 订货日期= #" & e.DataRow("订货日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))

Else

会出现;编译错误“If”必须以匹配的“End If”结束。错误代码:If e.Data Col.Name=“订货日期”the

 


--  作者:zoyong
--  发布时间:2017/5/10 14:08:00
--  
End If

完整代码发上来
[此贴子已经被作者于2017/5/10 14:09:42编辑过]

--  作者:xusuyang
--  发布时间:2017/5/10 14:16:00
--  
 

If e.DataCol.Name = "产品名称" Then

    If e.DataRow.IsNull("产品名称") Then

        e.DataRow("产品编码") = Nothing

    Else

        e.DataRow("产品编码") = GetPy(e.DataRow("产品名称"), 1)

    End If

End If

If e.DataCol.Name = "订货日期" Then

    If e.DataRow.IsNull("订货日期") Then

        e.DataRow("产品编码") = Nothing

    Else

        Dim bh As String = e.DataRow("产品编码") & Format(cdate(e.DataRow("订货日期")),"yyyyMMdd")

 

   

        If e.DataRow("订货编码").StartsWith(bh) = False

            Dim max As String

            Dim idx As Integer

    If e.DataRow.IsNull("产品编码") Then

max = e.DataTable.Compute("Max(订货编码)","产品编码 is null And 订货日期= #" & e.DataRow("订货日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))

Else


--  作者:zoyong
--  发布时间:2017/5/10 14:21:00
--  


  Dim max As String

  Dim idx As Integer

If e.DataCol.Name = "产品名称" Then

    If e.DataRow.IsNull("产品名称") Then

        e.DataRow("产品编码") = Nothing

    Else

        e.DataRow("产品编码") = GetPy(e.DataRow("产品名称"), 1)

    End If

End If

If e.DataCol.Name = "订货日期" Then

    If e.DataRow.IsNull("订货日期") Then

        e.DataRow("产品编码") = Nothing

    Else

        Dim bh As String = e.DataRow("产品编码") & Format(cdate(e.DataRow("订货日期")),"yyyyMMdd")

  If e.DataRow("订货编码").StartsWith(bh) = False          

    If e.DataRow.IsNull("产品编码") Then

max = e.DataTable.Compute("Max(订货编码)","产品编码 is null And 订货日期= #" & e.DataRow("订货日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))

Else

End If

End If

End If

End If




--  作者:xusuyang
--  发布时间:2017/5/10 14:42:00
--  

If e.DataCol.Name = "产品名称" Then
    If e.DataRow.IsNull("产品名称") Then
        e.DataRow("产品编码") = Nothing
    Else
        e.DataRow("产品编码") = GetPy(e.DataRow("产品名称"), 1)
    End If
End If
If e.DataCol.Name = "订货日期" Then
    If e.DataRow.IsNull("订货日期") Then
    End If
    e.DataRow("产品编码") = Nothing
   
    Dim bh As String = e.DataRow("产品编码") & Format(cdate(e.DataRow("订货日期")),"yyyyMMdd")
   
   
    If e.DataRow("订货编码").StartsWith(bh) = False
        Dim max As String
        Dim idx As Integer
        If e.DataRow.IsNull("产品编码") Then
            max = e.DataTable.Compute("Max(订货编码)","产品编码 is null And 订货日期= #" & e.DataRow("订货日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))
        Else
        End If
    End If
End If

为啥订货编码及产品编码均不显示


--  作者:有点蓝
--  发布时间:2017/5/10 15:08:00
--  
请不要重复提问题:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=100374