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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#ERROR



 
 
Thread Tools Display Modes
  #1  
Old February 26th, 2008, 12:53 PM posted to microsoft.public.access.gettingstarted
Bill B[_2_]
external usenet poster
 
Posts: 11
Default #ERROR

Hi All

I'm getting the #ERROR from the iif statement below

Control Source: =IIf([test_typ]="IMPA",IIf(Trim([shape])0,[shape]," ")," ")

[shape] is a four character string value from the database. It's attributes
are a "text field" wtih a name of "Text133"

Database attributes a

Field Size: 4
Required: No
Allow Zero Length: Yes
Indexed: No
Unicode Compression: No
IME Mode: No Control
IME Sentance Mode: None

If the field happens to be empty then the IIf false condition is returned
and a blank space is displayed. The only time the error is displayed is when
the [shape] variable is called.

Bill


  #2  
Old February 26th, 2008, 02:06 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default #ERROR

Perhaps the following will work for you.

Control Source: =IIf([test_typ]="IMPA",IIf(Len(Trim([shape] &
""))0,[shape]," ")," ")

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Bill B" wrote in message
...
Hi All

I'm getting the #ERROR from the iif statement below

Control Source: =IIf([test_typ]="IMPA",IIf(Trim([shape])0,[shape]," "),"
")

[shape] is a four character string value from the database. It's
attributes are a "text field" wtih a name of "Text133"

Database attributes a

Field Size: 4
Required: No
Allow Zero Length: Yes
Indexed: No
Unicode Compression: No
IME Mode: No Control
IME Sentance Mode: None

If the field happens to be empty then the IIf false condition is returned
and a blank space is displayed. The only time the error is displayed is
when the [shape] variable is called.

Bill




  #3  
Old February 26th, 2008, 02:59 PM posted to microsoft.public.access.gettingstarted
Bill B[_2_]
external usenet poster
 
Posts: 11
Default #ERROR

:-(

no joy. It's really got me baffled.

if I remove everything and just leave [shape] in this "Control Source" field
then the 4 character contents is displayed. The minute I try to run any kind
of condition on it I get errors.

Bill


"John Spencer" wrote in message
...
Perhaps the following will work for you.

Control Source: =IIf([test_typ]="IMPA",IIf(Len(Trim([shape] &
""))0,[shape]," ")," ")

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill B" wrote in message
...
Hi All

I'm getting the #ERROR from the iif statement below

Control Source: =IIf([test_typ]="IMPA",IIf(Trim([shape])0,[shape]," "),"
")

[shape] is a four character string value from the database. It's
attributes are a "text field" wtih a name of "Text133"

Database attributes a

Field Size: 4
Required: No
Allow Zero Length: Yes
Indexed: No
Unicode Compression: No
IME Mode: No Control
IME Sentance Mode: None

If the field happens to be empty then the IIf false condition is returned
and a blank space is displayed. The only time the error is displayed is
when the [shape] variable is called.

Bill






  #4  
Old February 26th, 2008, 03:16 PM posted to microsoft.public.access.gettingstarted
Duane Hookom
external usenet poster
 
Posts: 7,177
Default #ERROR

Make sure the name of the control is not the name of a field in your record
source. Then maybe try a control source of:
=IIf([test_typ]="IMPA" AND Len(Trim([shape] & ""))0,[shape]," ")

--
Duane Hookom
Microsoft Access MVP


"Bill B" wrote:

:-(

no joy. It's really got me baffled.

if I remove everything and just leave [shape] in this "Control Source" field
then the 4 character contents is displayed. The minute I try to run any kind
of condition on it I get errors.

Bill


"John Spencer" wrote in message
...
Perhaps the following will work for you.

Control Source: =IIf([test_typ]="IMPA",IIf(Len(Trim([shape] &
""))0,[shape]," ")," ")

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill B" wrote in message
...
Hi All

I'm getting the #ERROR from the iif statement below

Control Source: =IIf([test_typ]="IMPA",IIf(Trim([shape])0,[shape]," "),"
")

[shape] is a four character string value from the database. It's
attributes are a "text field" wtih a name of "Text133"

Database attributes a

Field Size: 4
Required: No
Allow Zero Length: Yes
Indexed: No
Unicode Compression: No
IME Mode: No Control
IME Sentance Mode: None

If the field happens to be empty then the IIf false condition is returned
and a blank space is displayed. The only time the error is displayed is
when the [shape] variable is called.

Bill







  #5  
Old February 26th, 2008, 07:25 PM posted to microsoft.public.access.gettingstarted
Bill B[_2_]
external usenet poster
 
Posts: 11
Default #ERROR Answer

shape is a reserved word. http://allenbrowne.com/Ap****ueBadWord.html

#2073 and is a Report property

I changed the name to shape1 and it runs like a charm.

Thank you

Bill

"Bill B" wrote in message
...
Hi All

I'm getting the #ERROR from the iif statement below

Control Source: =IIf([test_typ]="IMPA",IIf(Trim([shape])0,[shape]," "),"
")

[shape] is a four character string value from the database. It's
attributes are a "text field" wtih a name of "Text133"

Database attributes a

Field Size: 4
Required: No
Allow Zero Length: Yes
Indexed: No
Unicode Compression: No
IME Mode: No Control
IME Sentance Mode: None

If the field happens to be empty then the IIf false condition is returned
and a blank space is displayed. The only time the error is displayed is
when the [shape] variable is called.

Bill




 




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 08:20 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.