Hi, I have 2 access tables (table1, table2), table2 is related to the field "Nr Crt"(which is an AutoNumber) in table1 in a "one-to-many" relation. Table1 is connected to the vb form to textboxes, table2 is in DataGridView. Whenever I try to add data, the AutoNumber is set to -1, so the data from table2 is not saved correctly.I need a code for when I click the Add button the "Nr Crt" autonumber field will automatically be increased by 1.
The circled textbox in the image is the "Nr Crt" field in table1, and the circled field in the DataGridView is the related field from table2.The picture is taken right after I pressed the Add button.And I need a code that will automatically increase the "Nr Crt" field by 1 instead of setting it to -1.
The circled textbox in the image is the "Nr Crt" field in table1, and the circled field in the DataGridView is the related field from table2.The picture is taken right after I pressed the Add button.And I need a code that will automatically increase the "Nr Crt" field by 1 instead of setting it to -1.
Comment