From: John W. Vinson on
On Wed, 02 Jun 2010 18:57:21 GMT, "BenEl via AccessMonster.com" <u56454(a)uwe>
wrote:

>Private Sub Confirm_Click()
>
>If IsNull(DLookup("[PositionID]", "MT_Job_Candidates", "[PositionID] = " & Me.
>SelectJob & " AND [CandidateID] = " & Me.CandidateID)) Then
>MsgBox "This position is already attached to this candidate. Please choose
>another position.", vbOKOnly
>
>End Sub

Your expression is finding positions which are *NOT* attached to the candidate
(the DLookUp will return the position ID if there is a hit, and be null
otherwise). Change the line to

If Not IsNull(DLookup( <etc etc>
--

John W. Vinson [MVP]
From: BenEl via AccessMonster.com on
Oh my goodness!! Thankyou! (what a silly mistake on my part!!). It works
beautifully now!



John W. Vinson wrote:
>>Private Sub Confirm_Click()
>>
>[quoted text clipped - 4 lines]
>>
>>End Sub
>
>Your expression is finding positions which are *NOT* attached to the candidate
>(the DLookUp will return the position ID if there is a hit, and be null
>otherwise). Change the line to
>
>If Not IsNull(DLookup( <etc etc>

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201006/1