473,412 Members | 2,994 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,412 software developers and data experts.

unique data in a table.

I have a database, and in it i have a problem.

I have a table, from wich data is entered via a form.

How can i get access to not allow duplicate entrys into the same row.

Eg

I have a space for two names. if you enter Mark into one, and try and enter
mark into the other, i want access to bring up a message box saying
"duplicate name entered."

Do you get what i mean, or do i need to be more descriptive.

Thanks!!
Mark
Nov 12 '05 #1
2 1567
Mark,

You don't need two fields on your form! Go to the database window and the the
tables tab. Open your table in design view. Click on the fieldname where you
enter Mark. Go to the bottom - Field Properties - and click in the Indexed
properties. Select Yes(No Duplicates) in the drop down list. Access will now
throw up an error message when you try to enter a duplicate name in that field
on your form.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"mark solesbury" <ma************@SPAMlineone.net> wrote in message
news:MP*****************@newsfe3-win.server.ntli.net...
I have a database, and in it i have a problem.

I have a table, from wich data is entered via a form.

How can i get access to not allow duplicate entrys into the same row.

Eg

I have a space for two names. if you enter Mark into one, and try and enter
mark into the other, i want access to bring up a message box saying
"duplicate name entered."

Do you get what i mean, or do i need to be more descriptive.

Thanks!!
Mark

Nov 12 '05 #2
In the BeforeUpdate event of the second name text box check that the
value of the first text box is not the same:

IF Me.Name1 = Me.Name2 THEN
MsgBox "Duplicate name entered!"
Cancel = True
END IF

Pavel

mark solesbury wrote:

I have a database, and in it i have a problem.

I have a table, from wich data is entered via a form.

How can i get access to not allow duplicate entrys into the same row.

Eg

I have a space for two names. if you enter Mark into one, and try and enter
mark into the other, i want access to bring up a message box saying
"duplicate name entered."

Do you get what i mean, or do i need to be more descriptive.

Thanks!!
Mark

Nov 12 '05 #3

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

Similar topics

5
by: Westcoast Sheri | last post by:
Which will be a faster lookup of an item by, "color" in the following mySQL tables: "unique key," "primary key," or just plain "key"?? CREATE TABLE myTable ( number int(11) NOT NULL default '0',...
7
by: Tony Clarke | last post by:
Hi, I'm trying to write a system thats used for about 50 clients that uses html forms and php to log details. The problem is that when a client loads the form page it's given a value which is...
3
by: Bob | last post by:
Why, in the process of creating a unique index, does SQL Server allow me to select the "Ignore duplicate keys" option? Wouldn't I just create a non-unique index if I wanted to ignore duplicate...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
5
by: aj | last post by:
DB2 WSE 8.1 FP5 Red Hat AS 2.1 What is the difference between adding a unique constraint like: ALTER TABLE <SCHEMA>.<TABLE> ADD CONSTRAINT CC1131378283225 UNIQUE ( <COL1>) ; and adding a...
5
by: Marie | last post by:
Access97 I have a table containing addresses with a separate field for State. Is there a way to create a query that returns an unique list of the states in that table and still be updateable? I...
2
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like...
10
by: deko | last post by:
I understand it's possible to make a composite Primary Key by holding down the control key and selecting multiple fields, then right-clicking and selecting Primary Key. But I've heard that's not a...
3
by: Bruce Wood | last post by:
I know that this isn't a C# question, but I can't find a newsgroup specifically devoted to ADO.NET, other than a moribund one that deals with ADO in general. This problem is driving me to...
6
by: Alvin SIU | last post by:
Hi all, I have a table in Db2 v8 like this: Team Name Role ------ -------- --------------------- A Superman Leader A Batman Member A WonderWoman Member B ...
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.