Exiting Event of Field

I have a field entitled Affiliate that contains about 20 choices for user to choose from (all from a categorized view). However, now the mgr wants to add another item to list and make sure that if they choose that last item the user can not choose any other item with it (multiple value field). How do I do that? How would I set up my exiting event? Here is what I have so far. I just used the last item plus one other item to see if it works. It doesn’t.thanks

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Set uidoc = workspace.currentDocument

Call uidoc.Refresh

Set doc = uidoc.document



If doc.Affiliate(0) = "NLAN" AND doc.Affiliate(0)= "ABC" Then

	Msgbox "Can only use NLAN alone, not with other items in list ", 54, "REMINDER"

	Continue = False

End If

Subject: Exiting Event of Field

If it’s a multi value field that might not always work…

off the top of my head- try this…

Dim item As NotesItem

set item=doc.GetFirstItem(“affiliate”)

n=ubound(doc.affiliate)

if n>1 then

if item.Contains(“ABC”) then

msgbox “Sorry, can’t do that!”…

Subject: RE: Exiting Event of Field

That worked perfectly! grazie tanto (thank you so much).

Subject: RE: Exiting Event of Field

mi piacere (is that correct?) I need to practice…

Subject: RE: Exiting Event of Field

very close…il mio piacere! Again, thank you.

Subject: RE: Exiting Event of Field

Nancy,I tried to test with a user and all of sudden it doesn’t work…ugh! Can you look at my code…See anything?

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Set uidoc = workspace.currentDocument

Call uidoc.Refresh

Set doc = uidoc.document



Dim item As NotesItem

Set item=doc.GetFirstItem("Affiliate")

n=Ubound(doc.affiliate)



If n>1 Then

	If item.Contains("No Language Approval Needed") Then

		Msgbox "REMINDER: If you choose No Language Approval Needed in Affiliate field, you cannot make any other selection."

		Call uidoc.GotoField("Affiliate")

		

	End If

End If

thanks

Subject: RE: Exiting Event of Field

Nancy, also…customer wants to make sure that the user can not save the document if they haven’t fixed the affiliate once they get the prompt. Could I add something at the end of the exit event? or do I need to add something in the Save button?

THANK YOU!