Something like this in code should check whether the data format is what you
want:
Debug.Print CStr(Date()) = Format(Date(), "m/d/yyyy")
You could put it into an IF statement.
HOWEVER you will shortly become hated by your users. Why do you want to
enforce this rule this way? Why not use input masks to force users to put the
data in the way you want. Not that it matters as Access actually stored dates
and times as a number and not how it's entered in a Date/Time field.
If you want to see a certain date format on forms and reports, use the
Format function to display dates the way you want.

Signature
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
> Hi,
> I want to put a code in the Onload event of my main form to prevent users
> who don't have the date format as m/d/yyyy from logging to the database..
>
> How can i show an error message that says that the date format is not
> correct if it's not m/d/yyyy?
Pietro - 14 May 2008 16:36 GMT
Hi Jerry ,
I cannot use the property input mask for this purpose as in most cases
users don't put a date or time,but it's automatically picked from the system
settings,so sometimes if find date formatted in Arabic,or formatted as
d/m/yyyy
This causes seriuos problems..
Please advise...
> Something like this in code should check whether the data format is what you
> want:
[quoted text clipped - 17 lines]
> > How can i show an error message that says that the date format is not
> > correct if it's not m/d/yyyy?
John W. Vinson - 14 May 2008 18:22 GMT
> I cannot use the property input mask for this purpose as in most cases
>users don't put a date or time,but it's automatically picked from the system
>settings,so sometimes if find date formatted in Arabic,or formatted as
>d/m/yyyy
The Date() function will store the current date regardless of the system
settings. It's storing an actual date value, not a formatted text string,
unless you're (unwisely!) storing dates in Text fields.

Signature
John W. Vinson [MVP]
>Hi,
> I want to put a code in the Onload event of my main form to prevent users
>who don't have the date format as m/d/yyyy from logging to the database..
>
>How can i show an error message that says that the date format is not
>correct if it's not m/d/yyyy?
Ummm...
WHY?
You can control the date format of all the controls on your Forms or Reports,
independent of the users' system date format.
You can control the interpretation of date entry, independent of the users'
system date format (though there may be a training issue if you unwisely allow
ambiguous formats); if your data entry is constrained to (say) d-mmm-yyyy
format there is no ambiguity in what the user types.
Prohibiting legitimate users from opening your database, just because of a
preferred setting on their computer, is massive overkill.

Signature
John W. Vinson [MVP]