by John W. Lowther, Jr. (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (4 Votes)
One-Liner to generate a unique Id. Does NOT require a database. No autonumber fields needed.
Assumes
Assumes the system clock is never reset to a previous time. Could generate duplicate's if the system clock is reset to a prevoius time, but not likely due to the precision of the function.
Code Returns
UniqueID based on the System Clock
Public Function GetUniqueId() As String
GetUniqueId = Trim(Str(CDbl(Now) * 10000000000#))
End Function