473,378 Members | 1,369 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.

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 1642
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("CustomersTable","CustomerField")>2,"Ex isting 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
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...
15
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...
16
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
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...
8
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...
5
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...
82
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)...
2
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...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
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...

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.