代码有很多语法以及逻辑问题
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
Dim F As String = "采购单号 = '" & x & "'"
Dim drs As List(Of DataRow) = DataTables("采购单").AppendLoad("[采购单号] = '" & x & "'")
If drs.Count < 0 Then
Dim wz1 As Integer = Tables("采购单").FindRow(drs(0))
If wz1 >= 0 Then
Tables("采购单").Position = wz1
Forms("采购单_表单").show()
End If
End If
End If