I'm very much an Visual Basic noob... I'm trying to create a button on my Access form that can create a record and re-sequence my non-auto-incremented Primary Key to insert the record where I want it in the record list.
Currently, to do this I 1) Open the table, 2) use an AutoHotKey keyboard macro to manually edit the Primary Key number from the last record to where I want to insert my new record, 3) create a new record (with an appropriate value in my Primary Key column) at the bottom of the list, then 4) Right-click the column and "Sort from smallest to largest", and finally 5) use a second AutoHotKey macro to re-sequence the Primary Key from the new record to the end of the list.
I'd like a Command Button that will allow me to do the same with just one click.
The database currently has 897 records- adding a new record at #185 using the method I currently use seems tedious when it seems a FOR / NEXT (Step -1) Loop in VBA would be so much more efficient.
Some names I use:
- Form Name: [Anime Input Form]
- Table Name: [DVDs and Blu Rays]
- Primary Key Name: [AIN#]