hcl-bot
December 18, 2007, 2:00pm
1
I dont know what is happens
Dim key As String
Dim item As notesitem
If Not (key=“”) Then
Call item.AppendToTextList(key)//ERROR HERE
Else
Set docNew = viewNew.GetDocumentByKey(Cstr(fieldvalue),True)
Dim code As Variant
code= docNew.GetItemValue( "Code" )
Call item.AppendToTextList(code)'//ERROR HERE
end if
What I did wrong here?
Thanks for help,
hcl-bot
December 18, 2007, 2:06pm
2
Subject: Object Variable not Set Error
where did you set item??
as in
set item = doc.getFirstItem( “your field”)
John
hcl-bot
December 18, 2007, 2:21pm
3
Subject: RE: Object Variable not Set Error
yes…
Set item = doc.GetFirstItem( “test” )
hcl-bot
December 18, 2007, 3:16pm
4
Subject: RE: Object Variable not Set Error
This error means that there is no “test” field in your document, hence the object is not set, and the property cannot be called.
You should always test your objects before using their properties.
if item is nothing then
messagebox “No test field. Aborting…”
else
’ do your stuff here
end if
hcl-bot
December 18, 2007, 2:34pm
5
Subject: RE: Object Variable not Set Error
I don’t see it in your original code. Could it be that the field is not defined in your form, therefore it has not value ie.
set item = doc.getFirstItem( “your field”)
if item is nothing then
call doc.replaceItemValue( “your field”, “”)
set item = doc.getFirstItem( “your field”)
end if
else post the code where we can see where you set it.
John