Solved

DialogBox on Yes not working

Posted on 2009-04-14
1
324 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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.
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now