Dim x As String = Tables("入库表_table1").Current("采购单号")
Dim dr As DataRow
dr = DataTables("采购单").Find("[采购单号] = '" & x & "'")
If dr IsNot Nothing Then
Dim wz As Integer = Tables("采购单").FindRow(dr)
If wz >= 0 Then
Tables("采购单").Position = wz
Forms("采购单_表单").show()
End If
Else
If dr Is Nothing Then
Dim F As String = "采购单号 = " & dr("采购单号")
DataTables("采购单").AppendLoad("[采购单号] = '" & dr("采购单号") & "'")
If DataTables("采购明细").Find(F) Is Nothing Then '如果对应的订单明细没有加载过
DataTables("采购明细").AppendLoad(F) '则追载此订单的订单明细
End If
Dim wz1 As Integer = Tables("采购单").FindRow(dr)
If wz1 >= 0 Then
Tables("采购单").Position = wz1
Forms("采购单_表单").show()
End If
End If
End If
1、确定存在这条记录,使用msgbox可以正确的返回单号
2、确定选择的记录没有加载,查过多次了。
[此贴子已经被作者于2023/1/31 5:21:40编辑过]