Quote Originally Posted by SamOscarBrown View Post
Well, without looking at the project, "I" would create a new field in the table and call it something like 'buttonIndex' and when I inserted something into the table based upon the click event of the cmdbtn, I'd insert the index of the button right there. Then it will always be available, and at form load one could always sort the initial query by buttonIndex to put the correct caption on the correct cmdbtn.
Make sense?
There is already a field called "ID" in the database which holds the button index. The ID field is set as the primary key.

Quote Originally Posted by IkkeEnGij View Post
What is SlotNr? I already have already set the primary key for the database.

Quote Originally Posted by DataMiser View Post
I think that if the data is to be matched to a button index then adding the index of the button as an indexed field in the DB is the best way to go.
It doesn't matter if something is added, removed nor changed the index field will match the index of the control. Seems extremely simple to me.

Yes you could use the tag but why bother?

The way I understand it is each record is linked to a button so there should not even be a changing number of records, 1 record for each button, record index= button index no problem
So you are saying I need separate fields, one to hold the button index and one for the item number?