Public Class frmNodeConfigAdd Private pENTITYD As Integer Public Sub New(pParentID As Integer, pEntID As Integer, pEntity As String) MyBase.New() pENTITYD = pEntID InitializeComponent() ' Add any initialization after the InitializeComponent() call. Me.txtNodeParentID.Text = pParentID Me.txtEntityName.Text = pEntity End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If txtName.Text = String.Empty Then txtName.Text = "Please define an internal name" txtName.BackColor = Color.Yellow Exit Sub End If txtName.BackColor = DefaultBackColor Dim oInsert = $"INSERT INTO TBPMO_STRUCTURE_NODES_CONFIGURATION ([PARENT_NODE],[NAME],[ENTITY_ID],[COMMENT],[ADDED_WHO]) VALUES ({txtNodeParentID.Text},'{txtName.Text}',{pENTITYD},'{txtComment.Text}','{Environment.UserName}')" If MYDB_ECM.ExecuteNonQuery(oInsert) Then Me.Close() Else MsgBox("An error occured on insert! Check Your log!", MsgBoxStyle.Exclamation) End If End Sub Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click txtNodeParentID.Text = 0 End Sub End Class