Dialog box issue

hi all…

kindly help me. i use dblookup to get all the value from database and prompt the list, and it working, but how can i add new choice in dialog box that give user to fill up the course name rather than take from database… The keyword for user to choose if they want to fill in is -OTHERS-

Sub Click(Source As Button)

On Error Goto ErrHandlr



Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim db As NotesDatabase 

Dim tserver As String

Dim dbfilename As String

Dim lkpView As NotesView

Dim sessionDoc As NotesDocument



Set db = session.CurrentDatabase

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document



If uidoc.EditMode Then

	

	sReturnvalue = getdbserverpath(db,"Training Records Management")	'lookup server and db

	tserver = Strleft(sReturnvalue,"~") 	'lookup server and db

	dbfilename = Replace(Strright(sReturnvalue,"~"), "\", "/") 	'lookup server and db

	

	Set svrName = session.CreateName(tserver)

	

	cnLookup=DbColumn(tserver, dbfilename, "lsvCourseSession", 0)

	

	cnPrompt = ws.Prompt(PROMPT_OKCANCELLIST, "Course Name", "Select course name...", " " , Arrayunique(cnLookup))

	

	

	

	key = cnPrompt

	Set lkpView = db.GetView("lsvCourseSession")

	Set sessionDoc = lkpView.GetDocumentByKey(key, True)

	

	'If (cnLookup="-Others-") Then

	'	cnPrompt  = ws.Prompt(PROMPT_OkCancelEdit, "Course Name",  "Please enter new course name", " ")

	'End If

	

	' to check sessiondoc exist

	If Not (sessionDoc Is Nothing)  Then

		doc.CourseName = cnPrompt

		doc.TypeOfTraining = sessionDoc.TypeOfTraining

		doc.AppCat = sessionDoc.AppCat 

		doc.Objectives=sessionDoc.Objectives

		doc.CourseLocation = sessionDoc.CourseLocation 

		doc.Facilitator=sessionDoc.Facilitator

		doc.StartDate =sessionDoc.StartDate 

		doc.EndDate= sessionDoc.EndDate

		doc.Duration = sessionDoc.Duration

		doc.Act_CF =  sessionDoc.Act_CF

		doc.Refreshment	= sessionDoc.Refreshment

		doc.nFees= sessionDoc.nFees

		doc.TotalCFees= sessionDoc.TotalCFees

		doc.Payment= sessionDoc.Payment

		doc.Payable = sessionDoc.Payable

		Call uidoc.Refresh

		

	Else

		'Messagebox "The record for course profile cannot be found" & cnPrompt & " is not available. Kindly contact the respective person to create new. ", "Information"

		'MessageBox message [ , [ buttons + icon + default + mode ] [ , boxTitle ] ]

		Messagebox "The record for the course profile cannot be found"  ,MB_OK + MB_ICONINFORMATION, "Information"

		Exit Sub

	End If

End If





Exit Sub

ErrHandlr :

If Err = 4411 Then Exit Sub

Msgbox "ERROR : " & Err & " - " & Error & " at line " & Cstr(Erl),16,"Select Course Name Button"

Continue = False

Exit Sub

End Sub

Subject: dialog box issue

Add the new values to the ‘cnLookup’ array before prompting the user. ArrayAppend is one method you might use…