Solved

DialogBox on Yes not working

Posted on 2009-04-14
1
327 Views
Last Modified: 2013-12-18
For some reason I can't get this one quite right. I need to get the DialogBox working but only when dba7 is equal to Yes. What am I missing here. Have tried many version, but can't get it quite right. On the code below I am getting no response for either Yes or No.
Sub Exiting(Source As Field)
	Dim ws As New NotesUIWorkspace
	Dim sess As New NotesSession
	Dim doc As NotesDocument
	Set doc = sess.CurrentDatabase.CreateDocument
	If dba7 = "Yes" Then
		Call ws.DialogBox _
		( "dba_popup", True, True, True, True, _
		False, False, "DBA Alert", doc, True )
	End If
End Sub

Open in new window

0
Comment
Question by:jforget1
1 Comment
 
LVL 13

Accepted Solution

by:
CRAK earned 500 total points
ID: 24141995
I assume dba7 is a field on a document? Or is it a variable that has not been assigned yet?
If field: besides the newly created document object, you have no notesdocument available in your code. Should it be found in the form definition or in an open (NotesUIDocument) doc?
If newly creaded doc: that doc holds no fields yet. Please set the form-field and have the document computed based on that form. Something like:

Set doc = sess.CurrentDatabase.CreateDocument
doc.form="myFormName"
Call doc.ComputeWithform(True, False)

Then, rephrase your evaluation:

if doc.dba7(0) = "Yes" then

If dba7 is a field on an opened document, you'd have to access it in the code:

Dim UIDoc = NotesUIDocument
Set UIDoc = ws.CurrentDocument

if UIDoc.FieldGetText("dba7") = "Yes" then


The best way to avoid such problems is to enter following line in the Options section:

Option Declare

That will point out dba7 as undeclared variable at save/compile time, triggering you to a definition.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question