Code:
If str = "add" Then
''''''ADD NEW RECORD'''''''
If txtID.Text = "" Or txtFirst.Text = "" Or txtLast.Text = "" Or txtAddress.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Or TextBox7.Text = "" Or TextBox8.Text = "" Or TextBox9.Text = "" Or TextBox10.Text = "" Or TextBox11.Text = "" Or TextBox12.Text = "" Or TextBox13.Text = "" Or TextBox14.Text = "" Or TextBox15.Text = "" Or TextBox16.Text = "" Then
MessageBox.Show("All fields Are Required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
myqry = "INSERT INTO main (ML,DEVICE,LOT,QTY,GATING,DATE1,PKGTYP,DEVICE_NO,LOT_NO,SHELF,ACTUAL_P,E_RETURN,S_RETURN,VARIANCE,VARIANCE_REC,PULLEDBY,RETURN_TD,PROCESSBY,LOCATED,REASON) "
myqry = myqry + " VALUES('" & txtID.Text & "','" & txtFirst.Text & "','" & txtLast.Text & "','" & txtAddress.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox11.Text & "','" & TextBox12.Text & "','" & TextBox13.Text & "','" & TextBox14.Text & "','" & TextBox15.Text & "','" & TextBox16.Text & "')"
mycmd = New OleDbCommand
With mycmd
.CommandText = myqry
.Connection = conn
.ExecuteNonQuery()
End With
Call Set1()
End If
Comment