Help With Syntax Pls

C

Chris Lines

Guys

I would appreciate your help again pls. Using Acess 2003. Trying to get a
txtbox placed in a form header to return when a file is ready for archiving.

So, if the file is older than 36 months - and - is not already archived, I
want the txtbox to return that the particular file is due for archive. If a
file does not meet this criteria, I want the form header to stay blank.

I experimented with IIf, but I understand from other Posts that you can't
use AND with IIf. In the end, I think I've figured it out by using the
following:

=([txtMonthsElapsed]>=36 And ([Archived]=0))

But it is returning 0 or -1 in the header. I assume this is True and False.
Grateful pls for advice on (i) if this is the best approach; (ii) how I
substitute 0 and -1 for other text.

Thanks in Advance

Chris
 
J

John Spencer

Have you tried something like the following.

=IIF([txtMonthsElapsed]>=36 And [Archived]=0,"NEED TO ARCHIVE","Never Mind!")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
C

Chris Lines

John

You're a Legend!! Works just as I want it to. Thanks for your help. I am
grateful.

Regards

Chris

John Spencer said:
Have you tried something like the following.

=IIF([txtMonthsElapsed]>=36 And [Archived]=0,"NEED TO ARCHIVE","Never Mind!")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Chris said:
Guys

I would appreciate your help again pls. Using Acess 2003. Trying to get a
txtbox placed in a form header to return when a file is ready for archiving.

So, if the file is older than 36 months - and - is not already archived, I
want the txtbox to return that the particular file is due for archive. If a
file does not meet this criteria, I want the form header to stay blank.

I experimented with IIf, but I understand from other Posts that you can't
use AND with IIf. In the end, I think I've figured it out by using the
following:

=([txtMonthsElapsed]>=36 And ([Archived]=0))

But it is returning 0 or -1 in the header. I assume this is True and False.
Grateful pls for advice on (i) if this is the best approach; (ii) how I
substitute 0 and -1 for other text.

Thanks in Advance

Chris
 

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