Re: Comparing data in two different tables

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



That was supposed to be:

If DCount("[CasFileID]","[IDS]","[CasFileID]=" & Me.FileID.Text) > 0 Then
MsgBox "Hey, you bonehead, no duplicates allowed!"
End If

kingston wrote:
You can use a calculation to see if there are any matching records:
If DCount("[CasFileID]","[IDS]","[CasFileID]=" & Me.FileID.Text) Then
MsgBox "Hey, you bonehead, no duplicates allowed!"
End If

This assumes that the parameter is a number. Otherwise, you'll have to
enclose the input in single quotes.

My objective is to compare two fields that are located in different tables
which are in same database. In a table called ,"TEST", I have a field called
[quoted text clipped - 3 lines]
inform them of their duplication. I would like to build the event in the
Before Update Procedure. How can I acheive this by using VBA?

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

.



Relevant Pages

  • OT (was: Comparing data in two different tables)
    ... MsgBox "Hey, you bonehead, no duplicates allowed!" ... How can I acheive this by using VBA? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Checking multiple fields for Duplicate
    ... You still need to check for duplicates in the form AfterUpdate event. ... Dim stLinkCriteria As String ... MsgBox "First name is required!!", vbOKOnly + vbExclamation ...
    (microsoft.public.access.formscoding)
  • Re: Error Handling not working properly
    ... You could open a recordset on a "find duplicates" query that would return all the records with IDs that are in both the source table and the target table. ... Dim rs As DAO.Recordset ... MsgBox "Upload completed Successfully" ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)
  • Re: Checking multiple fields for Duplicate
    ... You still need to check for duplicates in the form AfterUpdate event. ... Dim stLinkCriteria As String ... MsgBox "First name is required!!", vbOKOnly + vbExclamation ...
    (microsoft.public.access.formscoding)
  • Re: Deleting all matched values in a range
    ... first place to start is reading the info on duplicates that Chip Pearson has ... on his website - ... > Hey guys ...
    (microsoft.public.excel.programming)