Hi guys,
I have a quick code question that I need some help with and it is the final piece of my puzzle
I have a combo box where a user will select the Record (Auto Number ID) that they want to edit and I have a command button which will open a Form to edit the selected record.
But say we have deleted records in between, and there is 11 records in the table but we are actually up to ‘Auto Number ID 15’, how do I write the code to open this ‘ID’ number, not the record?
currently if I select ‘Auto Number ID’ 12 it is bringing back ‘RECORD’ 12, not the ID 12.
Hope this makes sense? And any help appreciated!
The current code I have on the Command Button is:
Private Sub cmdEdit_Record_Click()
Dim RecordID As Long
RecordID = Me.cmbSelect_Record.Value
DoCmd.OpenForm "Edit_Record"
DoCmd.GoToRecord acDataForm, "Edit_Record", acGoTo, RecordID
End Sub
Me.cmbSelect_Record.Value gives the ID number of the record, but once a record gets deleted, this doesn’t match the recordID, therefore there is a mismatch in what it will open up.