VAlidation rule Month between

M

Mike

Does anyone know what validation rule will ensure my dates are between 01
March and 31 October. Many thanks for your time
Mike
 
6

'69 Camaro

Hi, Mike.
Does anyone know what validation rule will ensure my dates are between 01
March and 31 October.

Yes. Open the table in Design View and paste the following in this date
field's Validation Rule Property:

Month([CompDate])>=3 And Month([CompDate])<=10

Replace CompDate with the name of your field, then save the table. Only
dates between 1 March and 31 October -- for any year -- will be valid in this
field. Make sure that you use appropriate Validation Text to show the user
what dates are valid, because the default system warning message can be
confusing to many users.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are [email protected] and [email protected]

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.
 
M

Mike

Thankyou very much. Spot on, works great now. Thanks Again

'69 Camaro said:
Hi, Mike.
Does anyone know what validation rule will ensure my dates are between 01
March and 31 October.

Yes. Open the table in Design View and paste the following in this date
field's Validation Rule Property:

Month([CompDate])>=3 And Month([CompDate])<=10

Replace CompDate with the name of your field, then save the table. Only
dates between 1 March and 31 October -- for any year -- will be valid in this
field. Make sure that you use appropriate Validation Text to show the user
what dates are valid, because the default system warning message can be
confusing to many users.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are [email protected] and [email protected]

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.


Mike said:
Does anyone know what validation rule will ensure my dates are between 01
March and 31 October. Many thanks for your time
Mike
 
6

'69 Camaro

You're welcome! Since it worked for you, please consider signing into the
Microsoft Online Community and marking my first post as an answer so that
others who have the same question will be able to search and quickly find it
in the database of "answered" questions.

Thanks!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


Mike said:
Thankyou very much. Spot on, works great now. Thanks Again

'69 Camaro said:
Hi, Mike.
Does anyone know what validation rule will ensure my dates are between 01
March and 31 October.

Yes. Open the table in Design View and paste the following in this date
field's Validation Rule Property:

Month([CompDate])>=3 And Month([CompDate])<=10

Replace CompDate with the name of your field, then save the table. Only
dates between 1 March and 31 October -- for any year -- will be valid in this
field. Make sure that you use appropriate Validation Text to show the user
what dates are valid, because the default system warning message can be
confusing to many users.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are [email protected] and [email protected]

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.


Mike said:
Does anyone know what validation rule will ensure my dates are between 01
March and 31 October. Many thanks for your time
Mike
 
Top