Invalide Use of Null & Picture

Edwik

Registered User.
Local time
Today, 21:12
Joined
Aug 19, 2005
Messages
40
Hello.

Please help.

In form I want to see picture from another table and In form On Current i put sub:

Dim picPhotoString As Variant
Dim str1 As String
picPhotoString = Me!txtBox.value

sstr1= DLookup("[Field] ", "table", "[ID]= ' " & picPhotoString & " ' ")
Me!ObjectBoundFrame.value = str1
Me!ObjectBoundFrame.Requery

When table contain Photo, it shows, when no - I recieve error: "Invalide Use of Null".

Where is mistake?
 
If you do a lookup on the picture field in the table using the NZ function

spicture = NZ(dlookup(“[picturefield]”,”[Tablename]”),””)

If spicture <> “” Then
sstr1= DLookup("[Field] ", "table", "[ID]= ' " & picPhotoString & " ' ")
Me!ObjectBoundFrame.value = str1
Me!ObjectBoundFrame.Requery
end if
 
Thank You a lot!
Its realy works!
 

Users who are viewing this thread

Back
Top Bottom