mohammadagul
PrinceAtif
- Local time
- Today, 14:03
- Joined
- Mar 14, 2004
- Messages
- 298
Hello To All Sophisticated Programmer,
I have a simple problem. I am trying to Put Images in my forms. What i have done is :
1. Created a Text Field name imagePath.
2. Add an image Frame in the Form.
When the user double clikc the image fram the file locator dialog box appears(as you have seen in windows). The user choose the path of the image and add it inthe text field. The problem comes when there is no picture inthe image frame. System keeps on giving an error message as such.
Run Time Error 94
Invalid use of null
i found one function on Allen Brown Website which is as follows
Null2Zero(), StrLen()
These two functions are very simple but useful, since Nulls propagate like rabbits in Access.
Use Null2Zero() to prevent runtime errors when assigning values to non-variants,
or to prevent calculations choking over Nulls.
Function Null2Zero (AValue)
' Purpose: Return the value 0 if AValue is Null.
If IsNull(AValue) Then
Null2Zero = 0
Else
Null2Zero = AValue
End If
End Function
Len() returns Null as the length of a Null variant, so StrLen() is a quick substitute.
Since any non-zero value = True, you can test for no entry (Null or zero length string)
with If Not StrLen([MyControl]) Then
Function StrLen (AVariant) As Integer
' Returns the length of a variant or string, returning zero a
Null or zero-length string.
If IsNull(AVariant) Then
StrLen = 0
Else
StrLen = Len(AVariant)
End If
End Function
I have tried using the above codes but allinvain. the error keeps on coming. Is there any other way of removing the error.
Suggestion and answeres will be highly appretiated
Muhammad Atif Gul
I have a simple problem. I am trying to Put Images in my forms. What i have done is :
1. Created a Text Field name imagePath.
2. Add an image Frame in the Form.
When the user double clikc the image fram the file locator dialog box appears(as you have seen in windows). The user choose the path of the image and add it inthe text field. The problem comes when there is no picture inthe image frame. System keeps on giving an error message as such.
Run Time Error 94
Invalid use of null
i found one function on Allen Brown Website which is as follows
Null2Zero(), StrLen()
These two functions are very simple but useful, since Nulls propagate like rabbits in Access.
Use Null2Zero() to prevent runtime errors when assigning values to non-variants,
or to prevent calculations choking over Nulls.
Function Null2Zero (AValue)
' Purpose: Return the value 0 if AValue is Null.
If IsNull(AValue) Then
Null2Zero = 0
Else
Null2Zero = AValue
End If
End Function
Len() returns Null as the length of a Null variant, so StrLen() is a quick substitute.
Since any non-zero value = True, you can test for no entry (Null or zero length string)
with If Not StrLen([MyControl]) Then
Function StrLen (AVariant) As Integer
' Returns the length of a variant or string, returning zero a
Null or zero-length string.
If IsNull(AVariant) Then
StrLen = 0
Else
StrLen = Len(AVariant)
End If
End Function
I have tried using the above codes but allinvain. the error keeps on coming. Is there any other way of removing the error.
Suggestion and answeres will be highly appretiated
Muhammad Atif Gul