Solved

DialogBox on Yes not working

Posted on 2009-04-14
1
326 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
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…

792 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