Hi ISNULL Function

gane_mi2

Registered User.
Local time
Today, 21:37
Joined
Apr 15, 2012
Messages
12
Hi,

I wrote one query in Query table as follows...

SOUR_AREA: Trim(IIf(IsNull([PANELOUT].[AREA]),"",[PANELOUT].[AREA]) & IIf(IsNull([INSTROUT].[IAREA]),"",[INSTROUT].[IAREA]))

When I run the Result Its working fine... But when opening the form I getting the follwoing error...

"The isnull function requires 2 argument(s)"

Could someone help me for this error and explain why its happening?

Warm Regards
Ganesh
 
Last edited:
I am not sure, as far as I am aware IsNull takes in only one argument.. Instead try using the follwing.
Code:
Trim(IIf(Len([PANELOUT].[AREA] & "")=0,"",[PANELOUT].[AREA]) & IIf(Len([INSTROUT].[IAREA] & "")=0,"",[INSTROUT].[IAREA]))
 
Not sure exactly what you have or where the message came from. Here is info on IsNull

In Access, the IsNull function returns TRUE if the expression is a null value. Otherwise, it returns FALSE.

The syntax for the IsNull function is:

IsNull ( expression )

expression is a variant that contains a string or numeric value.


It often helps if you tell us in plain English what you are trying to do; then show us your code/snippet; and any error message/issue.
 
It also helps to prefex the Name of the tables with tbl e.g. tblArea and don't use all uppercase.

Try this but not tested.

SOUR_AREA: IIf(IsNull([PANELOUT].[AREA]),[PANELOUT].[AREA]) & " " & IIf(IsNull([INSTROUT].[IAREA]),[INSTROUT].[IAREA])

Is it IAREA or AREA

The way this is written AREA is a Field.

EDIT

I reread your post and now doubt that my code is correct. But I left it there incase it is of some help.
 
Last edited:
Hi,

I wrote one query in Query table as follows...

SOUR_AREA: Trim(IIf(IsNull([PANELOUT].[AREA]),"",[PANELOUT].[AREA]) & IIf(IsNull([INSTROUT].[IAREA]),"",[INSTROUT].[IAREA]))

When I run the Result Its working fine... But when opening the form I getting the follwoing error...

"The isnull function requires 2 argument(s)"

Could someone help me for this error and explain why its happening?

Warm Regards
Ganesh

While IsNull can be used in SQL like this, I normally use the SQL Standard "Is Null" instead. See if the following works:

SOUR_AREA: Trim(IIf(([PANELOUT].[AREA] Is Null),"",[PANELOUT].[AREA]) & IIf(([INSTROUT].[IAREA] Is Null),"",[INSTROUT].[IAREA]))

As an alternative, take a look at this Forum post on a similar Topic:

http://www.access-programmers.co.uk/forums/showthread.php?t=204689
 

Users who are viewing this thread

Back
Top Bottom