"Krechting" <m.*********@chello.nl> wrote in message
news:a7**************************@posting.google.c om...
Hi ALl,
I have a code that checks if the documents in a hyperlink field are still
where they should be. I use fileexist().
First I want to filter out all the hyperlink fields that are empty.
I open a recordset and browse through all the fields to check for the word
file. I cannot filter out the empty fields.
I have tried: If Len(.Fields("Link") <> 0 then
and: If Not IsNull(.Fields("Link")) then
and: If .Fields("link").Value <> 0 then
but nothing works fine. Somehow when a hyperlink field has been filled and
emptied again something remains there, so it is not NULL.
Can anyone help me out?
Regards
Marco
There are a number of possible values which would look blank on the screen.
A null value, a zero-length string and, harder to accidentally enter via a
form, one or more spaces. To test for any of these in one line, try:
If Len(Trim(Nz(.Fields("Link"), "")))=0
Firstly any null values are turned to zero-length strings, and then the
spaces are trimmed so any of the three above-mentioned values all become
zero-length strings and so you can check the length.
By the way, if the difference between null values and zero-length strings is
of no use to you in this application, you could change the design of the
table so this field cannot contain a zero-length string.