By far the easiest way is to set the data type of the Key field to AutoNumber, however that will be just numeric (but at least it will be unique, unlike what you want).
To have what you want would require a trigger, which Access doesn't support... but there might be a method that somebody knows of.
You may use AutoNumber (Random) for Key (in range -2147483648 to 2147483647) but output it as a unique Hex string of maximum of 8 characters: HKey = Right$("00000000" & Hex$(Key), 8)
When input is needed, convert Hex string back to Long: Key = CLng("&H" & HKey)
You may use AutoNumber (Random) for Key (in range -2147483648 to 2147483647) but output it as a unique Hex string of maximum of 8 characters: HKey = Right$("00000000" & Hex$(Key), 8)
When input is needed, convert Hex string back to Long: Key = CLng("&H" & HKey)
Instead of using Hex, you can use a more complicated way to convert back and fort between Long AutoNumber and KeyString.
Thankyou for your reply. I tried this but i dont know how to set this, while designing the table by design view.
I made the field type to autonumber, but after that how to do?
Thankyou