
此主题相关图片如下:1-12-2.png
想实现通过输入模具外形尺寸,自动匹配表中的现有机台,并定位在这一行,以下是在按钮“根据模具尺寸选择机台”的CLICK事件中代码
Dim nr As WinForm.TextBox = e.Form.Controls("TextBox5")
Dim nms() As String=nr.text.split("*")
Dim W As Integer=nms(0)
Dim L As Integer=nms(1)
Dim H As Integer=nms(2)
Dim exp As String
Dim r As Integer
exp="[哥林柱_X尺寸]> W And [哥林柱_Y尺寸]> L And [容模厚度_MIN] < H And [容模厚度_MAX]> H "
If nr IsNot Nothing Then '已经输入了尺寸
With CurrentTable
r = .Findrow(exp) '从第一行开始查找
If r >= 0 Then '如果找到的话
.Position = r '定位到找到的行.
Else
MessageBox.show("没有找到合适的机台,请确认输入的内容是否正确","提示")
End If
End With
Else
MessageBox.show("请先输入模具外形尺寸再进行查找","提示")
End If
上面的代码 提示出错找不到W列,不知道如何修改,麻烦老师帮忙改下
此主题相关图片如下:1-12-1.png
