I have a dataform which I created myself, it just has a few textbox fields and a checkbox which are all bound to the relevent db column.
I am calling this form when I want to create a new record or when I want to edit an existing record. Adding is working fine but editing is not. The table does not seem to be updated when I press the update/ok button.
The interesting thing is, for debuggin purposes I place a datagrid on the form which is bound to the same dataset. If I make a change there and press the ok button (i.e. run the same update code) the changes are written to the table.
I enclose the update code, but I feel the problem is not here.
PrivateSub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
Try
Me.OleDbConnection2.Open()
OleDbDataAdapter1.Update(DsAddEdit1)
MsgBox("updated!")
Catch ex As Exception
MsgBox(ex.ToString)
Finally
Me.OleDbConnection2.Close()
EndTry
Me.Hide()
EndSub
Has anyone come across such a problem or have a possible solution? Any help would be greatfully appreciated.
I am calling this form when I want to create a new record or when I want to edit an existing record. Adding is working fine but editing is not. The table does not seem to be updated when I press the update/ok button.
The interesting thing is, for debuggin purposes I place a datagrid on the form which is bound to the same dataset. If I make a change there and press the ok button (i.e. run the same update code) the changes are written to the table.
I enclose the update code, but I feel the problem is not here.
PrivateSub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
Try
Me.OleDbConnection2.Open()
OleDbDataAdapter1.Update(DsAddEdit1)
MsgBox("updated!")
Catch ex As Exception
MsgBox(ex.ToString)
Finally
Me.OleDbConnection2.Close()
EndTry
Me.Hide()
EndSub
Has anyone come across such a problem or have a possible solution? Any help would be greatfully appreciated.