Solved

DialogBox on Yes not working

Posted on 2009-04-14
1
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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