A
ajw
I am a VB.NET newbie...
I have a data entry form with text boxes bound to a dataset. The data source
is an Access table with the primary key field being an autoincrement field.
Everything works fine except adding a new record. When I use the following
code, the dataset count is incremented but the form does not position to the
new row nor can I position to it.
BindingContext(dsTest, "tblTest").EndCurrentEdit()
BindingContext(dsTest, "tblTest").AddNew()
I have also tried to add a row using the following code, but it also does
not allow me to access the new row unless I update the database the the next
two lines of code. Then an empty record is created with the correct
autoincremented field.
rw = dsTest.Tables("tblTest").NewRow
dsLocation.Tables("tbllocation").Rows.Add(rw)
UpdateDatabase()
I have been fighting this problem for several weeks and can not figure it
out. Any help would be appreciated. Or is there another board where I should
be posting this?
Thanks
aj
I have a data entry form with text boxes bound to a dataset. The data source
is an Access table with the primary key field being an autoincrement field.
Everything works fine except adding a new record. When I use the following
code, the dataset count is incremented but the form does not position to the
new row nor can I position to it.
BindingContext(dsTest, "tblTest").EndCurrentEdit()
BindingContext(dsTest, "tblTest").AddNew()
I have also tried to add a row using the following code, but it also does
not allow me to access the new row unless I update the database the the next
two lines of code. Then an empty record is created with the correct
autoincremented field.
rw = dsTest.Tables("tblTest").NewRow
dsLocation.Tables("tbllocation").Rows.Add(rw)
UpdateDatabase()
I have been fighting this problem for several weeks and can not figure it
out. Any help would be appreciated. Or is there another board where I should
be posting this?
Thanks
aj