Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Unbound/Text Boxes To "Intentionally" Track Duplicates

Status
Not open for further replies.

MoBetter

Technical User
Mar 19, 2007
33
0
0
US
I'm using Microsoft Access 2003 and I have an employee list with 500 employees. I created a REPORT and used a TEXTBOX to find duplicates because I recieved a "too complicated" error on the QUERY. The Employee ID is in the Report and the FName and LName comes up in the TEXTBOX NAME "text182". I used the code below to count each time the EMPLOYEE ID displays.

=DCount("[employeeID]","trail","reports!trialsubform![text182]"="reports!trialsubform![text182]")

I created another TEXTBOX using an "IIF STATEMENT" with the following code to reference the DCount TEXTBOX NAME "text436".

IIf([text436]>1,"Duplicated Listing"))

Instead of counting each time the Employee ID comes up for each Employee, the code returns the total number of Employee IDs (500). Is there something that I'm doing incorrectly?

Going to a book store to purchase a book to get what you're looking for... Hours of searching...

Researching pages throughout that book just to get the simple answer you're looking for, but still coming up with nothing... Wasted hours...

Asking a question on Tek-Tips and being provided with the correct step-by-step answers... PRICELESS
 
DCount("[employeeID]","trail","reports!trialsubform![text182]"="reports!trialsubform![text182]")

Does the If part of this not always evaluate to True? You are checking itself?

What are you trying to count? you should only have one record per employee ID, otherwise you have duplicate records.

SeeThru
Synergy Connections Ltd - Uk Telemarketing and Telesales Services
and
Synergy Mobile Solutions - UK Mobile phones, land lines and call packages

 
That is correct. I want it to check against itself.

=DCount("[employeeID]","trail","reports!trialsubform![text182]"="reports!trialsubform![text182]")

The IIF statement is returning true because the code is counting all of the employees and returns 500 for each. In reality, I need it to show 1 unless another employee is scheduled for the same time.

Going to a book store to purchase a book to get what you're looking for... Hours of searching...

Researching pages throughout that book just to get the simple answer you're looking for, but still coming up with nothing... Wasted hours...

Asking a question on Tek-Tips and being provided with the correct step-by-step answers... PRICELESS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top