Solved

Why table allowing duplicates?

Posted on 2015-02-13
8
85 Views
Last Modified: 2015-02-13
I have a table with two fields..  ID (PK) and RecordDate which is Short Date format.

I have the RecordDate Index property set as Yes (No Duplicates) and yet I can enter more than one record with today's date.

Why is it letting me do this?
0
Comment
Question by:SteveL13
  • 4
  • 4
8 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40607939
If you use Now for today's date it will happen. Do you use Date for setting the date?

/gustav
0
 

Author Comment

by:SteveL13
ID: 40607947
The field is ShortDate.  If I just enter a new record and type 02/13/2015 in the field it will accept it even though there is already a record with that date in it.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40608236
And if you enter that date a second time?

Are you the index is on this field alone and not both ID and RecordDate?

/gustav
0
 

Author Comment

by:SteveL13
ID: 40608425
I just changed the table so the RecordDate is the PK.  no dupes.  But it STILL lets me enter 02/13/2015 even through another record has that date.

I don't get it.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:SteveL13
ID: 40608444
I just attached a sample db.  I cannot get the table to stop accepting duplicate values in the RecordDate field.
Table-Example.accdb
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40608464
If you change the format to Standard you'll se the times:DupeDates.PNGYou have to ensure clean dates are entered.

/gustav
0
 

Author Closing Comment

by:SteveL13
ID: 40608499
Who would have thought?  Thanks as always!
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40608524
You are welcome!

/gustav
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now