Domino 9 und frühere Versionen > ND6: Entwicklung

Object Varibale not set

(1/1)

stitze:
Moin liebes Forum,

ich bekomme immer oben genannte Fehlermeldung. Folgender Zustand.

Ich habe eine Maske ("frmPublikation") mit einem Listenfeld und einen Button.
Über den Button rufe ich mit folgendem Code eine Dialogbox auf:


--- Code: ---Sub Click(Source As Button)

Const constrObjectName = "frmPublikation"
On Error Goto ErrHandler

Dim uiws As New NotesUIWorkspace
Dim db As New NotesDatabase( "", "ar13ra01.nsf" )
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim dialogdoc As NotesDocument
Dim varOk As Variant

Set uidoc = uiws.Currentdocument
Set doc = uiws.currentdocument.document
Set dialogdoc = db.createdocument

varOk = uiws.DialogBox( "frmDlgPublication" , False , False  , True  , False , False , False , "Änderungsbriefe auswählen",  dialogdoc, True, True )

If ((varOk = True)) Then
doc.txtAenderungsbriefeUnID = dialogdoc.GetItemValue( "txtAenderungsbreife" )
End If

Call uidoc.refresh
Call uidoc.refresh

Ende:
Exit Sub   

ErrHandler:
Call arOutputError(constrObjectName, Err, Erl(), Error())
Resume Ende

End Sub

--- Ende Code ---

In der Postopen Methode der Maske "frmDlgPublication" steht folgender Code:


--- Code: ---Sub Postopen(Source As Notesuidocument)

Const constrObjectName = "frmDlgPublication"
On Error Goto ErrHandler

Dim dbThis As New NotesDatabase( "", "ar13ra01.nsf" )
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim item As NotesItem

Dim docCollectionDocuments As NotesDocumentCollection

Dim docDocument As NotesDocument

Dim strSearchString As String
Dim strNewValue As String
Dim aryAEBFNr() As String

Dim i As Integer
Dim j As Integer
Dim intCount As Integer

Dim bolFind As Boolean

Dim aryClean As Variant

strSearchString = "@Contains( Art; ""Schlüsselbeschreibung"" )"

Set docCollectionDocuments = dbThis.Search( strSearchString, Nothing, 0 )

Redim aryAEBFnr( docCollectionDocuments.Count, 2 )

intCount = 1
j = 1

For i = 1 To docCollectionDocuments.Count

bolFind = False

Set docDocument = docCollectionDocuments.GetNthDocument( i )

For j = 1 To Ubound( aryAEBFNr, 1 )
If Not aryAEBFNr( j, 1 ) = "" Then
If docDocument.AEBF(0) = aryAEBFNr( j, 1 ) Then
bolFind = True

j = Ubound( aryAEBFNr, 1 )
End If
End If
Next

If Not bolFind Then
aryAEBFNr( intCount, 1 ) = docDocument.AEBF(0)
aryAEBFNr( intCount, 2 ) = docDocument.UniversalID

intCount = intCount + 1
End If
Next

Set uidoc = workspace.CurrentDocument
Set item = uidoc.Document.GetFirstItem("txtAenderungsbreife")

Msgbox item.Name 

For i = 1 To Ubound( aryAEBFNr, 1 )
If Not aryAEBFNr( i , 1 ) = "" Then
strNewValue =aryAEBFNr( i, 1 ) & "|" & aryAEBFNr( i, 2 )
item.AppendToTextList(strNewValue)
End If
Next

uidoc.Refresh

Ende:
Exit Sub   

ErrHandler:
Call arOutputError(constrObjectName, Err, Erl(), Error())
Resume Ende

End Sub

--- Ende Code ---

Rufe ich nun über den Auswahlbutton den Dialog auf, bekomme ich eben oben genannte Fehlermeldung.

Rufe ich das Formular "frmDlgPublication" aus dem Designer auf, funktioniert das ganze und wie gesagt in der Dialogbox scheitert das.

Hat jemand eine Ahnung wo der Denkfehler liegt?

Als Anmerkung, das Formular "frmPublication" soll nicht gespeichert werden, sondern dient nur zum zwischenspeichern des Ergebnisses aus der Dialogbox, weil im weiteren Verlauf noch eine Dialogbox aufgerufen werden soll und diese Ergebnisse plus die Ergebnisse der ersten Dialogbox werden dann auf die Datenbank angewandt.

Mfg

Sebastian

koehlerbv:
Und in welcher Zeile kommt der Fehler ? Wo ist Dein ErrorHandling ?

Bernhard

stitze:
Wo der Fehler kommt ist schwer zu sagen, da der LS Debugger nicht den Quelltext aus einer Dialogbox debuggt, aber mittels Msgbox konnte ich feststellen das es anscheinend schon in der Ersten Zeile vorkommt.

Mh, Error Handling, das wär nochmal was, binde es mal ein, vieleicht bringt mich das ja weiter, thx, für den Tipp, sollten wir eigentlich auch immer machen, war etwas faul das einzubinden.

Gruß

Sebastian

stitze:
So hab das Errorhandling hinzugefügt, aber kommt trotzdem noch die Fehlermeldung. Die Meldung, welche der Errorhandler rausschmeissen sollte, lässt auf sich warten  :-:.

Mfg

Sebastian

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln