A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IIF Function error in Access 2003



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2010, 11:31 AM posted to microsoft.public.access.forms
Steve Muir
external usenet poster
 
Posts: 6
Default IIF Function error in Access 2003

Hi,

Following on from my separate post yesterday regarding issues I'm having
after creating a database in Access 2007 which some users need to use from
Access 2003.

I have the following IIF function working perfectly in a form in Access 2007
which is now returning a #Name? error in 2003 when the same form/database is
opened with 2003 and I have no idea why?

=IIf([ContractEndDate] Between Date() And Date()+90,"To Be
Renewed",IIf([ContractEndDate]Date()+90,"In
Contract",IIf([ContractEndDate]Date(),"Contract Expired","Start/End Date
Missing")))

As I said, this formula is working perfectly in 2007. Any suggestions would
be greatly appreciated. I have tried to recreate the formula from scratch in
a new field and still get the #Name? error. It is not a typo and the field
"ContractEndDate" is part of a query used to populate the form and is there
on the form. What could be causing this???

I will NEVER develop in 2007 again if any users are going to be running
access 2003!!!!!!!!!!!!!!!!!

Many thanks

Steve Muir
  #2  
Old March 16th, 2010, 12:00 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default IIF Function error in Access 2003

In Access 2003 I need to do something like this:

=IIf([ContractEndDate] = Date() And [ContractEndDate] = Date()+90, etc.

A possible simplification:

=IIf([ContractEndDate] Is Null, "Start/End Date Missing", _
IIf([ContractEndDate] Date() + 90,"In Contract", _
IIf([ContractEndDate]Date(),"Contract Expired", _
"To Be Renewed")))

Line continuation characters (underscores) are for clarity here only. They
are only for VBA, and would not be in an expression otherwise.


Steve Muir wrote:
Hi,

Following on from my separate post yesterday regarding issues I'm having
after creating a database in Access 2007 which some users need to use from
Access 2003.

I have the following IIF function working perfectly in a form in Access 2007
which is now returning a #Name? error in 2003 when the same form/database is
opened with 2003 and I have no idea why?

=IIf([ContractEndDate] Between Date() And Date()+90,"To Be
Renewed",IIf([ContractEndDate]Date()+90,"In
Contract",IIf([ContractEndDate]Date(),"Contract Expired","Start/End Date
Missing")))

As I said, this formula is working perfectly in 2007. Any suggestions would
be greatly appreciated. I have tried to recreate the formula from scratch in
a new field and still get the #Name? error. It is not a typo and the field
"ContractEndDate" is part of a query used to populate the form and is there
on the form. What could be causing this???

I will NEVER develop in 2007 again if any users are going to be running
access 2003!!!!!!!!!!!!!!!!!

Many thanks

Steve Muir


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201003/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.