473,378 Members | 1,346 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,378 software developers and data experts.

Find how many similar records..

N J
Hi,

I want my form to tell me if there are similar records based on a certain
field. For example, I currently have a record open on my form with
12*@abc.com as a data in a field. I want the form to search the table for
any other records with that same data in that field and tell me in a text
box....'This is an existing customer' if there is 2 or more records, or
'This is a new customer' if there is just one record.

TIA

Nick J
--

Kind Regards,
Customer Services,
Blue Lagoon Products
http://www.fastminimoto.co.uk
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
Nov 13 '05 #1
3 1772
On Sun, 04 Sep 2005 15:32:47 GMT, "N J"
<bl*************@blueyonder.co.uk> wrote:

You could use the DCount function:
Me.txtDuplicatesMessage = "You already have " &
DCount("EmailAddress", "tblCustomers", "EmailAddress='" &
Me.txtEmailAddress & "'") & " customers with this email address."
Note the single-quotes around the email address value.

If you don't want duplicates, you are MUCH better off putting a unique
index on the field(s) that make up a unique customer.

-Tom.
Hi,

I want my form to tell me if there are similar records based on a certain
field. For example, I currently have a record open on my form with
12*@abc.com as a data in a field. I want the form to search the table for
any other records with that same data in that field and tell me in a text
box....'This is an existing customer' if there is 2 or more records, or
'This is a new customer' if there is just one record.

TIA

Nick J


Nov 13 '05 #2
N J
Hi,

I have tried this and I keep getting #Name? :(

Please explain what you mean by unique customer. What I do is I import my
orders from a Tab Delimated file from Paypal, some customers have purchased
from me before.

--

Kind Regards,
Customer Services,
Blue Lagoon Products
http://www.fastminimoto.co.uk
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:hc********************************@4ax.com...
On Sun, 04 Sep 2005 15:32:47 GMT, "N J"
<bl*************@blueyonder.co.uk> wrote:

You could use the DCount function:
Me.txtDuplicatesMessage = "You already have " &
DCount("EmailAddress", "tblCustomers", "EmailAddress='" &
Me.txtEmailAddress & "'") & " customers with this email address."
Note the single-quotes around the email address value.

If you don't want duplicates, you are MUCH better off putting a unique
index on the field(s) that make up a unique customer.

-Tom.
Hi,

I want my form to tell me if there are similar records based on a certain
field. For example, I currently have a record open on my form with
12*@abc.com as a data in a field. I want the form to search the table for
any other records with that same data in that field and tell me in a text
box....'This is an existing customer' if there is 2 or more records, or
'This is a new customer' if there is just one record.

TIA

Nick J

Nov 13 '05 #3
On Sun, 04 Sep 2005 23:44:18 GMT, "N J" <in**@bluelagoonproducts.com>
wrote:

I was speculating about a few things:
* You have a textbox called txtDuplicatesMessage
* You have a table called tblCustomers, with a field called
EmailAddress
* You have a textbox called txtEmailAddress
You should adjust the syntax to the actual names used in your
application. Or just look up DCount in the help file.

I was also speculating you were talking about adding new records to a
Customers table. Now I understand you're dealing with an Orders table,
so duplicate email addresses can be appropriate.

-Tom.

Hi,

I have tried this and I keep getting #Name? :(

Please explain what you mean by unique customer. What I do is I import my
orders from a Tab Delimated file from Paypal, some customers have purchased
from me before.


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Justin Hoffman | last post by:
This is a question concerning query optimisation. Sorry if it's a bit long, but thanks to anyone who has the patience to help - This is my first post here... If I have two tables:...
25
by: Tor Erik Sønvisen | last post by:
Hi I need to browse the socket-module source-code. I believe it's contained in the file socketmodule.c, but I can't locate this file... Where should I look? regards tores
3
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: ...
2
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering...
3
by: MostlyH2O | last post by:
Hi Folks, I have a query that joins 3 tables. One of the tables (SalaryData) has data where there may be duplicate records with different dates. Of those duplicate records, I want the query to...
6
by: BerkshireGuy | last post by:
I need to create a query that will filter out records based on records. There can be many combinations depending of what the uses selects. For instance: Field: Telemed - This is a Y or N...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
1
by: TheScullster | last post by:
Hi all Bit of an obscure one this, but hopefully someone will be able to help. 4 years ago we had a potentially catastrophic problem with our Access database. From memory it was written in...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.