Reserved Error (-3087)

So, for example, does this give you an error?
Code:
=Sum(IIf([strProgram]="Primary",1,0))
Nope. and if I give like
Code:
Sum(IIf([datApplication Datem]Between Date() and Date()-7,1,0))

I am not getting Error. But if I am giving these two criteria together I am getting Error.

Thanks
 
Nope. and if I give like
Code:
Sum(IIf([datApplication Datem]Between Date() and Date()-7,1,0))

I am not getting Error. But if I am giving these two criteria together I am getting Error.

Thanks
Looks like there may have been spelling errors earlier. Does this work?
Code:
=Sum(IIf([strProgram]="Primary" AND [datApplication Datem] Between Date()-7 And Date(),1,0))
 
It seems to me that getting a "Reserved" error indicates something is drastically wrong and it isn't syntax. Getting oddball and seemingly inappropriate error messages often signals the presence of corruption. Do you recall ever getting an error about "Unreadable Format" and you did a compact & repair to recover it?

First thing to look at: In the code window, when you look at Tools >> References, are any of the checked references showing either the word Missing or the word Broken on the same line as the named library?

Second thing to try: Have you done a compact & repair on this DB lately (or at all)? If you did a C&R in response to the "Unreadable Format" message mentioned earlier, your answer is YES but one more try probably wouldn't hurt. On the other hand, it might not help either in that case.

Third thing to try: Look at this article (linked below) and DECOMPILE your code, then recompile it.


Fourth (and ugliest) possibility: You might have to build a new, empty database and use the External Data feature in the ribbon to copy everything from your old DB to your new one because something internal has become corrupted.
 
Hi,

I think I solved this. I have created a query to get the Total count of the Records based on my two criteria and then create a Subreport then in the Record Source give that query and it's working fine.

Thanks
 
Glad that it is working for you.

However, I would advise you to be on the lookout for a return of inexplicable errors that don't seem to apply to the line of code (or section) being called out. If you start getting unexplained errors, reconsider the possibility of corruption.
 
Hi,

I think I solved this. I have created a query to get the Total count of the Records based on my two criteria and then create a Subreport then in the Record Source give that query and it's working fine.

Thanks
Congratulations! Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom