473,748 Members | 7,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check to see if customer exists

Hi,

We have an inhouse database that I designed in access 2000 with the help of
all you guys some time ago. It stores orders and prints packing slips etc.

I would like to put onto the packing slip wether this is a new customer or
an existing customer. We do have a customer table, just one table for
customer details, orders, notes etc, this is what works best for us as data
is imported from payment files...anyway. ..

I require code that will lookup the 'Buyer_ID' in tblDownload and if it has
2 or more records of that buyer ID, then a label to say 'Existing Customer'
on the report. Would anybody be able to help me?
--

Thank You,

Nick Jones
Customer Services
Blue Lagoon Products
Sep 7 '06 #1
1 1664
use an unbound control on your Packing Slip report and use DCount() on
the customer table and check that the result is >1.
(Not at my computer, so I'm going to wing this and probably do it
wrong).

IIF(DCount("Cus tomersTable","C ustomerField")> 2,"Existing Customer",
"New Customer")

the basic idea (since my code is no doubt wrong, but you can get the
right syntax from Help) Using DCount with give you the number of
records in the table that match the criteria specified (Count of
CustomerField>2 ). You can use that to determine which note to show on
your report. Just create an unbound control and put in the iif
statement.

Sep 7 '06 #2

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

Similar topics

2
11858
by: Jonathan | last post by:
I am looking for a simple way to check if a database table exists. I keep getting advice to use "Try.. Catch" and other error handling methods, but I obviously don't want to have to display an error message and stop the process every time someone loads the script after the table is created because that would mean the page could only ever run once which of course not the solution I was looking for. I simply want to know how I can check...
15
1416
by: Paul T. Rong | last post by:
Hi, everybody! There is a text box in the form, when I type a customer name, I would like the typed name to be checked whether the name matches one in the customer_name field of the customer_info table. Is it possible? I don't want to use the combo box. Any suggestions? Thank you for any help! Paul from Bratislava, Slovakia
16
5664
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
2
2674
by: dhyder | last post by:
I'm using ASP.Net 1.1 and C#. Testing DB is currently Access 2003. This is basically my code set-up: string checkUser = "SELECT * FROM customer WHERE username = " + tbUser.Text; if (query returns value) (<--- That is where my problem is) { lblError.Text = "That username is already taken." } else { INSERT info INTO DB
8
2141
by: Alan | last post by:
Hello, I need to write a systemtray program to check every minute if a certain intranet page exists. Would "webBrowser.Navigate" and catching exceptions to it be a good choice in terms of load on the PC? If the page exists, the program should load and display it. The program would run on a couple of thousand PCs and the idea is to have a very basic, one-to-many instant message.
5
2282
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, having a List<stringand Dictionary<int, stringhow can I check that every string in the list is also in the Dictionary (and viceversa)? (and raise an exception when not). Thanks in advance -- Luigi
82
10049
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a) html b) perl script (print and inserting into database) Cheers... Andrew
2
3207
by: rahullko05 | last post by:
I want to add a check condition to the column. I use the following script DROP TABLE IF EXISTS `Customer`; CREATE TABLE `Customer` ( `CustomerId` INT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT ,`Name` VARCHAR(16) NOT NULL ,`Sex` CHAR(1) CHECK('M') ,PRIMARY KEY (`CustomerId`) );
2
14658
by: qwedster | last post by:
Folk! How to programattically check if null value exists in database table (using stored procedure)? I know it's possble in the Query Analyzer (see last SQL query batch statements)? But how can I pass null value as parameter to the database stored procedure programattically using C#? Although I can check for empty column (the following code passes string.Empty as parameter but how to pass null value?), I cannot check for null value...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.