Document.Title property causes error!

Hi,

I have detected a strange problem:

Hte below code works fine for most databases but for 2 db’s it raises the error “Illegal use of property”

…

Set DB=Session.GetDatabase(“xyz.nsf”)

if Db.isopen=true then

Set Doc.DbTitle=DB.Title '<----------- BANG!

end if

The strange thing is that this only happens with 2 DB’s . I already have checked these DB’s, compacted them etc.; no difference. These 2 DB’s are shown on the Workspace without problem. The corresponding formula language command delivers an empty string ! :frowning:

In the debugger I can see the title, it’s there and if the above command is executed… bang !

Any ideas whats wrong ?

Joe

Subject: Document.Title property causes error !

Hi Joe,

You don’t need to use the Set keyword when setting the field on your form. Your line:

Set Doc.DbTitle=DB.Title

should be:

Doc.DbTitle=DB.Title

Emily.

Subject: RE: Document.Title property causes error !

Hi Emily,

thanks for your response. I don’t know why but I have used the SET only here in my messages. In my original source code it isn’t used.

But your response open my eyes a bit wider and . . . I have found the problem:

If Doc.Title(0)=“” Then

Doc.Title(0)=DB1.Title

End If

The bad old incosistency problem in the Notes syntax accessing fields!

It of course should be “Doc.Title=DB1.Title” as Notes doesn’t allow, for whatever reason, writing only into one part of a field.

The error message was also not clear. But good thing is I finally have found the problem

Thanks

Joe