Remember dates are actually stored as double number datatype.
The formatting has no effect on the stored date.
Whilst the query designer will correctly understand your regional date format, VBA won't.
The supplied code is using the U.S. date format as required by VBA.
Yes. The code will work whatever regional date format you have.
For example, UK dates are dd/mm/yyyy but the code still works.
You cannot use dd/mm/yy in the code. If you try it will be automatically converted to the best 'guess' mm/dd/yyyy equivalent and it will often get it wrong
For example, type 'If Date>#31/12/19# Then' in the VBE.
It will be rewritten as 'If Date > #12/19/1931# Then'
So, to repeat, when working with dates using code, dates must be in one of the accepted formats.
Either mm/dd/yyyy ...or you can use yyyy-mm-dd