microsoft access courses - data validation ms access

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » microsoft access courses - Data validation in Ms access

microsoft access courses - Data validation in Ms access

resolvedResolved · Low Priority · Version Standard

Dave has attended:
No courses

Data validation in Ms access

Hi,

I wanted to know how to do data validation in Microsoft access 2002. Any tips on data validation for my Microsoft access database tables would be great.

Thanks
David

RE: Data validation in Ms access

Hi Dave

To do data validation correctly with Microsoft Access 2002, you really need to write some code within vba that will check the input from the forms and make sure that go through the rules that you have set. If they fail then you can display an message box asking the using to try again and explain the format required. Alternatively if you do not want to use vba, you can use a very basic form of validation known as an input mask. This checks that the input meets certain conditions, such as first letter of name is uppercase and the rest is lowercase, however if this is not set by the user, access will automatically convert it to the requirements of the input mask.

Hope this helps
David

RE: Data validation in Ms access

Very useful


 

Access tip:

Calculating The Difference Between Dates

If you wish to calculate the time between two date fields, this can be done in a number of ways:

1. As a calculated field in a query
2. As a calculated control in a form or report
3. As a calculation in a VBA procedure.

The basic syntax to get the number of days between two dates is:

=[One Date Field] - [Another Date Field]

You can also use one of the following functions:

=Month([One Date Field] - [Another Date Field])
which calculates the number of months between the two fields

=Year([One Date Field] - [Another Date Field])
which calculates the number of years between the two fields.

Another function is the DateDiff() function.

It uses an argument to determine how the time interval is measured. For example:

=DateDiff("q",[One Date Field] - [Another Date Field])
returns the number of quarters between the two fields.

Other intervals that can be used in this expression are as follows:
"yyyy" - Years
"m" - Months
"d" - Days
"w" - Weekdays
"ww" - Weeks
"h" - Hours
"n" - Minutes
"s" - Seconds

View all Access hints and tips


Server loaded in 0.08 secs.