473,385 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

check duplicated records from 2 table

25
I'm trying to check for duplicates from 2 table based on 2 fields. For example if the year and month is the same for table A and Table B then i will not import the record from Table B to Table A. But i have no idea how to do so. I have this and it has an error.

If DCount("*", "[All_part Report]", ([All_part Report].[Month] = [Temp].[Month])) > 0 Then
MsgBox "This is a duplicate"


Pleeeeaaase and THANK YOU!
Sep 10 '07 #1
3 1412
JKing
1,206 Expert 1GB
The last parameter also needs to be a string.

Expand|Select|Wrap|Line Numbers
  1. If DCount("*", "[All_part Report]", "[All_part Report].[Month] = [Temp].[Month]") > 0 Then
  2.  
Sep 10 '07 #2
hr833
25
The last parameter also needs to be a string.

Expand|Select|Wrap|Line Numbers
  1. If DCount("*", "[All_part Report]", "[All_part Report].[Month] = [Temp].[Month]") > 0 Then
  2.  
Hey JKing

I used the code you give me but it returns me an error '2001'

Why is this so?
Sep 10 '07 #3
JKing
1,206 Expert 1GB
I think the problem is you're trying to draw data from more than one table within your criteria string.

My suggestion is to either use the built-in wizard for finding duplicate information in tables. You can get to the wizard by going to Tools > Analyze > Tables

The other idea is to write a query rather than use DCount.
Sep 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Josh Armstrong | last post by:
I need a form to check for duplicates before a new record is added. Table name: Links Field1: LinkSysNum Field2: SysNum For example, =539 is linked to =540 =544 The db is setup using a...
7
by: Amy | last post by:
I'm trying to add an autoincrementing id to a table based on an existing field Name, but Name has duplicated records. How can I do that in ACCESS? Thanks. Amy
1
by: Isabel Puigdevall | last post by:
I'm trying to create a report in a dotnet.asp project. I made the report in Crystal Reports based on a dataset with two tables linked in a one to many relationship. The output report shows me...
1
by: anonieko | last post by:
> This is a common problem with some solution > > /*********************************************************************************** * * Problem: * Determine the Duplicated Records in a...
2
by: orenlevy1 | last post by:
Hi Everyone. I have a problem that I could not figure out what to do with it. I have a couple of tables and views. All have the same unique ID. When a user try to do a search on our web site...
6
by: Ryan Liu | last post by:
Hi, If I have tens of thousands DataRow in a DataTable and allow the end user to pick any DataColumn(s) to check for duplicated lines, the data is so large, is there a better API, algorithm can...
1
by: Davidsm | last post by:
Hi, please can you assist me with the following I am coming up with duplicated records in a table. I have run a find Duplicates query and it has listed all the duplicates. How do i run a delete query...
4
by: sanQUEST | last post by:
hi, can anybody can tell me how to add pry constraint to a table if it has already duplicated records ? san
3
by: moorcroft | last post by:
Hi I am trying to write some sql to because we have a missing foregin key constraint. The following is what I have been asked to do: 1. COMPULSORY_WORK.reference to LISTED_BUILDING.reference ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.