1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access VBA Code Problem

Discussion in 'Business Applications' started by stealthey_99, Aug 13, 2007.

Thread Status:
Not open for further replies.
  1. stealthey_99

    stealthey_99 Thread Starter

    Aug 11, 2007
    Hello Friends ,

    Please check this VBA Code for finding the duplicated in a database and once ot finds it , it takes you to that record

    Dim SID As String
    Dim stLinkCriteria As String
    Dim rsc As DAO.Recordset

    Set rsc = Me.RecordsetClone
    SID = Me.[Email Address].Value
    stLinkCriteria = "[Email Address]=" & "'" & SID & "'"

    If DCount("[Email Address]", "Table_ContactPerson_Names", _
    stLinkCriteria) > 0 Then
    'Undo duplicate entry
    'Message box warning of duplication
    MsgBox "Warning Email Address " _
    & SID & " has already been entered." _
    & vbCr & vbCr & "Taking u to the record.", _
    vbInformation, "Duplicate Information"

    rsc.FindFirst stLinkCriteria
    'Me.Bookmark = rsc.Bookmark
    End If
    Set rsc = Nothing
    End Sub
    ----> Now the problem is that the email address entry is a subform in a main form and
    this does not seem to work for me . Any Suggestion .To be Precise , It does find the duplicate and gives me error message but cannot go to the specefied record probably due it being in a subform . Any Suggestions would be appreciated

    Sushil Dhar
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/609400

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice