Question : There is a(n) " in the form control's validationrule property

Hello All:

I am working in MS Access 2002, and I have a form field for which I want to validate the entries.  The entries I want to prevent the user from entering reside in a table called CompletedJobs.  When the user enters one of the jobs in that field, a message should pop-up telling them that the entry is not valid.

So, I did this using the Validation Rule field on the form.  The code I entered is the following:

(IIf(DCount("[ItemNumber]","[CompletedJobs]","[ItemNumber]=[Allocated]")>0,True,False))=False

The weird thing is that this exact code above ABSOLUTELY works correctly in another form that I already have built.  But in this particular form, I get a message that says "There is a(n) " in the form control's ValidationRule property."  It appears to object to my quotation marks in only this case.  Why?  And why does this exact same thing work in a different form?  How can I fix this?

Answer : There is a(n) " in the form control's validationrule property

<<>>
use this syntax for text:
DCount("[ItemNumber]","[CompletedJobs]","[ItemNumber]= '"& [Allocated] & "'") = 0
Random Solutions  
 
programming4us programming4us