validation rule problem

D

Deepak

Hi

I have created a query [Acceptable Dates] where i m calculating two dates A1
and A2

Now i have a form Premium Paid, where i m inputting the premiums paid by
users. The form has three entries viz

Policy No
Premium Paid Date
Premium

the user has to enter a policy no. and select the date when the premium was
paid

i have created a validation rule for premium paid date on the form itself in
the property sheet like this
= DLookUp("[A1]","[Acceptable Dates]","[Policy Number]=" & [Forms]![Premium Paid]![Policy No]) And <=DLookUp("[A2]","[Acceptable Dates]","[Policy Number]=" & [Forms]![Premium Paid]![Policy No])

Basically i want that user will be able to select any date between the dates
a1 and a2 which i have calculated in query, otherwise it should display error
message.

But the problem is that i m not able to enter some of dates between the two.

Kindly help is my method correct or is there any other way to do this.

Thanks
Deepak
 
J

June7

Are you getting error message when the date is rejected?
Could also do this verification with code in the BeforeUpdate event of the
date textbox. Would basically be the same condition statement as in the
ValidiationRule property. Might be easier to debug.

Deepak said:
Hi

I have created a query [Acceptable Dates] where i m calculating two dates A1
and A2

Now i have a form Premium Paid, where i m inputting the premiums paid by
users. The form has three entries viz

Policy No
Premium Paid Date
Premium

the user has to enter a policy no. and select the date when the premium was
paid

i have created a validation rule for premium paid date on the form itself in
the property sheet like this
= DLookUp("[A1]","[Acceptable Dates]","[Policy Number]=" & [Forms]![Premium Paid]![Policy No]) And <=DLookUp("[A2]","[Acceptable Dates]","[Policy Number]=" & [Forms]![Premium Paid]![Policy No])

Basically i want that user will be able to select any date between the dates
a1 and a2 which i have calculated in query, otherwise it should display error
message.

But the problem is that i m not able to enter some of dates between the two.

Kindly help is my method correct or is there any other way to do this.

Thanks
Deepak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top