Forgot the code:
Code

im dt As DataTable = DS1.main
Dim dr As DataRow, selectedrows() As DataRow
selectedrows = dt.Select("id=" & CInt(Label3.Text))
For Each dr In selectedrows
ListBox1.Items.Add(dr.Item("itemno"))
Next
dr("status") = "Insane"
OleDb_Punch.Update(DS1)
DS1.AcceptChanges()
Working:
Code:If MessageBox.Show("Are you sure you want to save changes to existing item?", "Confirm Update", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = DialogResult.OK Then
Try
Dim dt As DataTable = DS1.main
Dim dr As DataRow, selectedrows() As DataRow
selectedrows = dt.Select("id=" & CInt(Label3.Text))
' dt.Rows.Find("18")
For Each dr In selectedrows
'ListBox1.Items.Add(dr.Item("itemno"))
Next
' MsgBox(cmb_room.SelectedValue.ToString)
dr("text") = txtpunch2.Text
dr("room") = cmb_room.SelectedValue.ToString
dr("room_desc") = TextBox2.Text
If cmb_problem.Text = "" Then
dr("Problem_type") = ""
dr("Problem_abbr") = ""
Else
dr("Problem_type") = cmb_problem.Text
dr("Problem_abbr") = cmb_problem.SelectedValue.ToString
End If
If cmb_problem.Text = "-- Select Problem Type --" Then
dr("Problem_type") = ""
dr("Problem_abbr") = ""
End If
If cmb_contacts.Text = "" Then
dr("resp") = "Please Select Contact"
dr("resp_abbr") = "Please Select Contact"
Else
dr("resp") = cmb_contacts.Text
dr("resp_abbr") = cmb_contacts.SelectedValue.ToString
End If
If cmb_contacts.Text = "-- Select Contact --" Then
dr("resp") = "Please Select Contact"
dr("resp_abbr") = "Please Select Contact"
End If
dr("status") = cmbStatus.Text
If cmbStatus.Text = "Closed" Then
dr("date_closed") = Now()
End If
If cmbStatus.Text = "Open" Then
dr("date_closed") = System.DBNull.Value
End If
OleDb_Punch.Update(DS1)
DS1.AcceptChanges()
Catch exc As System.Exception
MessageBox.Show("error in FunctionUpdateRecord: " & exc.ToString)
Finally 'clean up
' cmd.Connection.Close()
' cmd.Dispose()
' cmd = Nothing
cmb_room.ResetText()
cmb_problem.ResetText()
cmb_contacts.ResetText()
cmbStatus.ResetText()
cmbStatus.ResetText()
End Try
End If