Mark XY Brown 23.Apr.12 11:03 AM a Web browser Domino Designer 6.0.3 Windows XP
I'm not sure what I want to do is possible, but I'm trying it anyway.
I'm in the middle of designing a questionnaire database. I've modelled it so that there is a set of current question documents that are controlled by the owning department. For each new interviewee, the users will create an interview document, and upon first saving, the interview document generates one answer document for each current question.
So far, so good.
The answer documents for each interview are displayed in an embedded single-category view (categorised on interview ID), displayed only after the interview is saved (and therefore only when it has something to display). This also works.
The problem is that I would like to make it possible for the users to scroll through all the answer documents in a dialog box, so that they don't have to keep closing and opening documents. To that end, I created a script library that declares various objects (workspace, session, database, view, document collection, six documents and a series of variables) and a copy of the answer form. On this copy, I created a set of Hotspot action buttons to use to navigate through the answer documents that relate to this interview. The action subs (controlled from within the script library) all work in a similar way - derive the ordinal number of the required document, close the current document, open the dialog box again displaying the required document.
This code does not work. Instead of moving to the required document, the error message "Object variable not set" is displayed. As the code is running in a dialog box, I can't debug it to see what's wrong.
I suppose what I'm asking boils down to this:
* Is what I'm trying to do possible?
* If it is, what am I doing wrong?
Comments and pointers gratefully received! I can post bits of the code if you want.
I have achieved my goal.
The problem was that I was using a sub within the script library to display a dialog box, and then trying to use other subs within the same script library in action buttons on the dialog box.
Instead, I'm using the script library to initialise the objects that I need. The script to invoke the dialog box is contained within a loop, so I don't need to use the library code recursively.