Access (VBA) to create unique ID numbers for alike records
Experts:
I need some assistance with (potentially) a VBA function that **adds a unique ID number** to records. If records are alike (based on various demographics), the same new ID number must be replicated.
In other words, qryTable1 should be turned into a "Make Table" (and using the VBA function) and then add **8 records** with each alike record (based on [Name] and [Age] to the **new ID" field. Alternatively, qryTable2 should be turned into a "Make Table" (and using the VBA function) and then add **9 records** with each alike record (based on [Name] and [Age] and [Ethnicity] to the **new ID" field.
As a picture is worth a thousand words, I believe (hope) the additional information in the spreadsheet provides sufficient information.
IDs are usually used as primary keys, so they must be unique.
Unless you're speaking about a foreign key, but in that case, you should name it accordingly.
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
Sequential Rows in Microsoft Access
It will create a row number for each unique combo of fields, say: [Name] & CStr([Age])
Please note, that a demo is for download.