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

Duplicates

Hi All,

I have a student database where all details of students are entered directly
onto a main form, there are a number of subforms on this that record each
students activities. One of these is an absence form that is based on a
small table as follows;

Absence No - Autonumber Primary Key
Student ID - linked to main student table
Date
Authorised
Reasons

I need to make sure that the date field cannot be repeated in this subform
for this student yet allow other students to also be absent on this date on
their form, but I'm not sure how to do this. I know that I can prevent this
when creating the table, but if student A is absent on say 9th June, then it
wouldn't allow any other student to be absent on that date. Hope I've
explained this properly, would appreciate any help you may be able to give.
I think that I'm probably have to go into the coding area for this, but I
only have very limited experience of using this.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200706/1

Jun 9 '07 #1
5 1958
You can create an index such that the combination of StudentID + Date must
be unique.

Before you do this, I'm going to suggest that you rename the field to
AbsentDate. Date is a reserved word, and will cause you problems.

Open the table in design view.
Open the Indexes dialog (toolbar.)
On a fresh row in the dialog, enter 2 rows like this:
StudentidAbsentdate StudentID Ascending
AbsentDate Ascending

Note that the index name is blank on the 2nd row. That indicates that the
index is on the combination of the 2 rows.

Select the first row of the index, and in the lower pane of the Indexes
dialog, set the Unique property to Yes.

This will prevent you adding 2 records for the same combination.

For more info about field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tazzy via AccessMonster.com" <u26845@uwewrote in message
news:736e0cc48c03b@uwe...
Hi All,

I have a student database where all details of students are entered
directly
onto a main form, there are a number of subforms on this that record each
students activities. One of these is an absence form that is based on a
small table as follows;

Absence No - Autonumber Primary Key
Student ID - linked to main student table
Date
Authorised
Reasons

I need to make sure that the date field cannot be repeated in this subform
for this student yet allow other students to also be absent on this date
on
their form, but I'm not sure how to do this. I know that I can prevent
this
when creating the table, but if student A is absent on say 9th June, then
it
wouldn't allow any other student to be absent on that date. Hope I've
explained this properly, would appreciate any help you may be able to
give.
I think that I'm probably have to go into the coding area for this, but I
only have very limited experience of using this.
Jun 9 '07 #2
Hi Allen,

Thanks very much for your help on this. I've changed the date field as you
suggested and also changed the details for the indexing. When I tried to
save the table, I got the error message saying that this would create
duplicates in the index, primary key or relationship, I'm not too sure where
I'm going wrong here

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200706/1

Jun 9 '07 #3
Does that mean you already have some records in the table where a person has
2 records for the same date?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tazzy via AccessMonster.com" <u26845@uwewrote in message
news:736f4f93b829f@uwe...
Hi Allen,

Thanks very much for your help on this. I've changed the date field as
you
suggested and also changed the details for the indexing. When I tried to
save the table, I got the error message saying that this would create
duplicates in the index, primary key or relationship, I'm not too sure
where
I'm going wrong here
Jun 9 '07 #4
Hi Allen,

I can see why you answer these type of questions - you're a physic!

Yes, I did have one date duplicated for a student, I deleted that, followed
your instructions and it works just the way I need.

Thank you so much for your help - live long and prosper

Kind Regards,
Tazzy

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200706/1

Jun 9 '07 #5

"Tazzy via AccessMonster.com" <u26845@uwewrote in message
news:73729ad786c77@uwe...
Hi Allen,

I can see why you answer these type of questions - you're a physic!
And a psychic too!
Jun 10 '07 #6

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

Similar topics

8
by: Michelle | last post by:
hi, i have created an array from recordset containing user names eg. (davidp, davidp, evenf, patricka, rebeccah) which i have sorted in alphabetical order, but i need to identify duplicates...
6
by: Marlene | last post by:
Hi All I have the following scenario, where I have found all the duplicates in a table, based on an order number and a part number (item).I might have something like this: Order PODate Rec...
16
by: tyrfboard | last post by:
I've been searching for awhile now on how to remove duplicates from a table within an Access db and have found plenty of articles on finding or deleting duplicates. All I want to do is remove them...
3
by: AK | last post by:
Hi Our product uses MS-SQL Server 2000. One of our customer has 10 installations with each installation stroring data in its own database. Now the customer wants to consolidate these databases...
7
by: vsgdp | last post by:
I have a container of pointers. It is possible for two pointers to point to the same element. I want to remove duplicates. I am open to which container is best for this. I thought of using...
14
by: ak | last post by:
Is it possible to find repeated(duplicate) element in an array in single loop ? AK
3
by: ryan.paquette | last post by:
In the table there are 2 fields in which I wish to limit (i.e. No Duplicates) Although I do not want to limit them to "No Duplicates" separately. I need them to be limited to "No Duplicates" as...
7
by: john.cole | last post by:
I have searched all the groups I can, and I still haven't been able to come up the solution I need. I have the following problem. In my form named sbfrmSpoolList, I am entering a job, spool and...
1
by: tskmjk55 | last post by:
Recently, I have a requirement to develop a vb.net application wherein the input excel sheet data which has an average of 5000 records should be checked for Internal duplicates (duplicates within the...
3
Thekid
by: Thekid | last post by:
I'm trying to figure out a way to find if there are duplicates in an array. My idea was to take the array as 'a' and make a second array as 'b' and remove the duplicates from 'b' using 'set' and then...
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...
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...
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
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...
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...

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.