Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation Rule Problem 1

Status
Not open for further replies.

awl

IS-IT--Management
Aug 2, 2001
136
US
My goal is to have the [PYes/No] column indicate a Yes or No if the [PdDate] column is less than today’s date, when I open up the tblData A. My [PYes/No] data type is Yes/No and in the properties of the [PYes/No] field I have entered in the Validation Rule: IIf([PdDate]<Now(),&quot;Yes&quot;,&quot;No&quot;). An error displays the following when I try to save the changes: Invalid SQL syntax – cannot use multiple columns in a column-level CHECK constraint. Is there another way to word this, without having to do a separate query?
 
You can set this up in a form where all data entry should be. There are lots of things you can't do in a table that can easily be accomplished in a form since forms and controls have events while Access tables don't.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Yes, I would like to go with your suggestion. I do have a form &quot;frmData Table 1&quot; based on my &quot;tblData 1&quot;. I'm not too sure on the structure of the control on the form which will automatically place a Yes or No in the [PdYes/No] field. Thanks. Curtis..
 
You would probably add code to the after update event of the control bound to PdDate.
Me.[PdYes/No] = Me.PdDate<=Date()


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thanks for your help, it works as a charm. Thank you. Curtis.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top