Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
philip1009
in reply to: Anonymous

The easiest solution to use is to wrap the ChangeRow function in a Try statement.  Here's an example:

 

SyntaxEditor Code Snippet

oLength = 20 'input the Length your looking for here.
Try
	iPart.FindRow("iComponentName:1", "Length", "=", oLength)
Catch
	MessageBox.Show("Part Length of " + CStr(oLength) + " not found!", _
	"Length Error", _
	MessageBoxButtons.OK, _
	MessageBoxIcon.Hand, _
	MessageBoxDefaultButton.Button1)
End Try 

 It will try to find a row where the column "Length" has a value of 20, if it's found, it will automatically change to that row.  If an error occurs, it will catch that error and display a message box for you.