daneb
March 29th, 2001, 07:17 PM
Hi.
I have a listview in lvwReport view which displays the contents of an Access database table similar to the one below (sample only):
Order Name
1 A
2 B
3 C
4 D
5 E
In this form, the user can add/insert new record, delete/edit existing record. My problem is that sometimes, after an operation, the Order adjusts incorrectly. This happens especially during editing. For instance, if the order is edited, say record 5 becomes record 2, the listview must display this as a result:
Order Name
1 A
2 E
3 B
4 C
5 D
Sometimes, the Order becomes duplicated, or it doesn't change, or skips numbering. Sometimes, the same thing happened when I try to insert a new record or delete a record located somewhere at the center of the list. I tried using the AutoNumber feature in Access but the value didn't adjust automatically and an error appeared if I entered an Order value equal to an existing Order number. The listview gets its data from the database. So, if the database has the wrong ordering, the listview also displays wrong data. How can I implement these procedures and avoid errors in displaying the correct Order in both the database and the listview?
If this is an ordinary add/insert/delete/edit operation on records without regard to the numbering, this would be easier, but can anyone help me? Thanks for the info in advance!
I have a listview in lvwReport view which displays the contents of an Access database table similar to the one below (sample only):
Order Name
1 A
2 B
3 C
4 D
5 E
In this form, the user can add/insert new record, delete/edit existing record. My problem is that sometimes, after an operation, the Order adjusts incorrectly. This happens especially during editing. For instance, if the order is edited, say record 5 becomes record 2, the listview must display this as a result:
Order Name
1 A
2 E
3 B
4 C
5 D
Sometimes, the Order becomes duplicated, or it doesn't change, or skips numbering. Sometimes, the same thing happened when I try to insert a new record or delete a record located somewhere at the center of the list. I tried using the AutoNumber feature in Access but the value didn't adjust automatically and an error appeared if I entered an Order value equal to an existing Order number. The listview gets its data from the database. So, if the database has the wrong ordering, the listview also displays wrong data. How can I implement these procedures and avoid errors in displaying the correct Order in both the database and the listview?
If this is an ordinary add/insert/delete/edit operation on records without regard to the numbering, this would be easier, but can anyone help me? Thanks for the info in advance!