How to Display Gregorian Dates as Hijri Dates in Microsoft Access
Question details
The user needs a method to visually format and display standard Gregorian dates as Hijri dates within Microsoft Access without losing the ability to compute and compare the original date values.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Localizing database applications to display the Hijri calendar instead of the default Gregorian calendar.
- Observed behavior
- Dates must be presented in the Hijri format on the front end while retaining the fixed numeric DateTime value in the back end for accurate chronological sorting.
Ensure you have basic familiarity with the Visual Basic for Applications (VBA) editor in Microsoft Access and have backed up your database before making code modifications.
Use VBA to Change the Calendar Display Property
Switch the global calendar context in Access to Hijri using a straightforward VBA command.
By modifying the built-in VBA.Calendar property, Microsoft Access will automatically display output dates in the Hijri calendar format. Because the underlying DateTime value remains a standard numeric double, all chronological sorting, additions, and comparisons will continue to work without data corruption.
In your Microsoft Access database, press ALT + F11 to launch the Visual Basic for Applications editor.
Within your desired module or form load event, enter the code `VBA.Calendar = vbCalHijri`. This instructs the application to format dates using the Hijri calendar.
To verify the change, open the Immediate Window (CTRL + G) and type `? Date`. Press Enter, and it will return the current date in the Hijri format (e.g., 1442-12-27).
If you need to return the database display to standard dates, run the command `VBA.Calendar = vbCalGreg`.

Looking for a Lightweight Alternative for Data and Document Management?
While Microsoft Access is used for complex relational databases, WPS Office provides a free, lightweight, and highly compatible suite with a familiar UI for managing your everyday spreadsheets, date calculations, and documents with seamless migration.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install the Suite: Run the installer to quickly set up WPS Writer, Spreadsheet, Presentation, and PDF tools.
- 3. Import Your Data: Export your Access data as CSV or Excel files, and open them in WPS Spreadsheet to easily track, calculate, and format your dates.

Frequently Asked Questions
Does changing the calendar to Hijri affect my stored database tables?
No, changing the VBA.Calendar property only affects how the dates are formatted and displayed. The underlying data in your tables remains securely stored as a numeric DateTime value.
Can I perform date calculations while the Hijri calendar is active?
Yes. Since the actual numeric value of the date does not change, all standard date calculations, comparisons, and chronologically ordered queries will function normally.
Why isn't there a straightforward formatting option for Hijri in the Access table design?
While Access supports various date formats, dynamically switching an entire application's chronological context reliably across forms and reports is best handled through the global VBA.Calendar property.




