ACC2002: How to Generate Random Dates (304085)
The information in this article applies to:
This article was previously published under Q304085 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SUMMARY
By using the Rnd function in Visual Basic for Applications (VBA), you can generate a random date value. This may be useful for generating sample data for your application or for testing values. This article shows you two functions that you can use to generate random dates.
REFERENCESFor more information about generating random numbers, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type rnd function in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about date values, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type date data type in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbhowto KB304085 |
---|
|