?
Solved

DialogBox on Yes not working

Posted on 2009-04-14
1
Medium Priority
?
330 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 2000 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

Industry Leaders: 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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

801 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