I have table in MS Access that has an AutoNumber
type in field ID
After inserting some rows, the ID
has become 200
I am going to Necro this topic.
Starting around ms-access-2016, you can execute Data Definition Queries (DDQ) through Macro's
ALTER TABLE ALTER COLUMN COUNTER(1,1);
- Save the DDQ, with your values
- Create a Macro with the appropriate logic either before this or after.
- To execute this DDQ:
- Add an
Open Query
action
- Define the name of the DDQ in the
Query Name
field; View
and Data Mode
settings are not relevant and can leave the default values
WARNINGS!!!!
- This will reset the AutoNumber Counter to 1
- Any Referential Integrity will be summarily destroyed
Advice
- Use this for Staging tables
- these are tables that are never intended to persist the data they temporarily contain.
- The data contained is only there until additional cleaning actions have been performed and stored in the appropriate table(s).
- Once cleaning operations have been performed and the data is no longer needed, these tables are summarily purged of any data contained.
- Import Tables
- These are very similar to Staging Tables but tend to only have two columns: ID and RowValue
- Since these are typically used to import RAW data from a general file format (TXT, RTF, CSV, XML, etc.), the data contained does not persist past the processing lifecycle
- 热议问题