Dim dr As DataRow Dim str As String = Forms("窗口11").Controls("TextBox1").Value dr= DataTables("产品库").Find("产品名称 ='" & Str & "'") If dr IsNot Nothing Then Dim r As Row = Tables("要输入的表").AddNew r("第一列") = Str str = Nothing Else MessageBox.Show("产品库无此产品!","提示") Return str = Nothing End If