mortensencs
asked on
Last Record not working
I have an access database which I use the built in, First, Previous, Next and Last record buttons to access the records individually as needed. For some reason, there was a record that was deleted. It went from primary key 469 to 471.
This has caused the database to think that record 469 is the last record, when there are many more after that.
This has caused the database to think that record 469 is the last record, when there are many more after that.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you mean that the record numbers in the navigation buttons are different to the primary key values then that is normal.
The record counter at the bottom left is just that - a counter. It has nothing to do with any values in the records. The record counter would still operate if there was no number key in the record.
If you have used an autonumber field for your ID then you will have gaps in the number sequence where IDs have been used but either deleted or never saved. So the counter and the id are quite independent. You can easily see this if you sort the records into a different sequence. The record counter will still run from 1 to the however many records there are.
The record counter at the bottom left is just that - a counter. It has nothing to do with any values in the records. The record counter would still operate if there was no number key in the record.
If you have used an autonumber field for your ID then you will have gaps in the number sequence where IDs have been used but either deleted or never saved. So the counter and the id are quite independent. You can easily see this if you sort the records into a different sequence. The record counter will still run from 1 to the however many records there are.
It appears I misread the question. However, the code snippet I provided does give the questioner a means to "skip" deleted or uncreated records..
ASKER
Emil Gray: I think that will help solve the problem, deleted records seem to be the problem, something I have figured out is there is a one to many relationship between the first and second table, it seems that when the "Save" button is used, it causes the next record button to show the record as many times as the save button is used. I will try adding that code to skip to the next record, I think that will help solve the problem.
ASKER
Thank you for your assistance!!
ASKER
Thanks in advance