PC Review


Reply
Thread Tools Rate Thread

dlookup help

 
 
deb
Guest
Posts: n/a
 
      12th Jan 2010
1) What am I doing wrong?

Want to display dupe msg if ([ContactSubID]= 48 and [Current] = Yes) or
[ContactSubID]= 49 and [Current] = Yes)

2) should this go in before update of ContactSubID and Current or the form?

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset '

Set rsc = Me.RecordsetClone

stLinkCriteria = "([ContactSubID]= 48 or [ContactSubID]= 49 and
[Current] = Yes)"
'Check table for duplicate ID
If DCount("ContactSubID", "t41ContactsProj ", stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Warning Current Manager was previously entered." _
& vbCr & vbCr & "Verify and make changes(as needed).", _
vbInformation, "Duplicate Information"
End If
Set rsc = Nothing
End Sub
--
deb
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dlookup using a date defiined by another dlookup =?Utf-8?B?QmVubnlESGlsbA==?= Microsoft Access VBA Modules 1 8th Aug 2007 01:56 AM
Help with DLookup lucky33 Microsoft Access Form Coding 3 16th Jul 2007 01:10 AM
Re: Dlookup function - copying the dlookup info into a field.... Douglas J. Steele Microsoft Access Forms 0 6th Dec 2006 02:05 PM
Using DLookUp =?Utf-8?B?QXJhY2E=?= Microsoft Access Queries 5 10th Jan 2005 08:01 PM
Dlookup problems (was my Dlookup hell) Kavvy Microsoft Access Form Coding 3 18th Nov 2003 12:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.