Validating dates in access
There are a few ways to have Access insert today's date, but the simplest way is add a simple Date() function to the Default Value property of your table.
Let's say we have a database that tracks applicants and case workers, and when cases are assigned, signed out, and closed.
to be honest I think I do until I try and apply it!
Is there a way of doing it that way or should I still use Date Diff but in a public function and call it in the form?
Since you've stated that the Order Date is always today, the general syntax for checking to see if the Required By Date is equal to or before the Order Date, and popping up a warning is this is true, would be something like: If Required By Date The general syntax for calling this function would be Check Date(Req Date) where Req Date is the date you're checking.
So, in the code module for your form, to call the function, assuming your date field is named Required By Date, you'll need this: You should be set now.
Access can do that for you, and you don't have to be an Access expert to do so!Consider the following table your data validation "cheat sheet." It contains samples of the most common types of .Feel free to copy, modify, or mix and match these examples to create your own validation rules.Without a doubt, is the most powerful tool you can use to prevent data-entry errors.With , Access actually tests data to make sure that it conforms to what you want to appear in the table.