View Full Version : help on duplicate entry


bill crumpton
04-22-2000, 09:00 AM
How can I restrict a record to not be duplicated per date but able to be duplicated on another date. For example, today I do not want the user to be able to duplicate a certain field in a record but tomorrow I want to allow the user to be able to duplicate the field. Any help on this please??

gino
04-22-2000, 04:34 PM
i am a bit confused on what you really want. can you be more specific? but anyways...if you want to have no duplicates...check your indexes.....in your table.

if you want a user not to duplicate dates you should have multiple indexes by userid and date.

[This message has been edited by gino (edited 04-22-2000).]

bill crumpton
04-25-2000, 04:56 AM
thanks for your help Gino.....I designed a database thats information is grouped and entered by date. I have a combo box on a form that hold a list of items for the user to choose from. I need for the user to be able to choose only ONE of those items PER DAY. If the user tries to choose the same item on the same day I need a pop up box to give instructions. However, I want the user to be able to choose that item on the next day. This is why No Duplicates doesn't work. Any Suggestions?

Pat Hartman
04-25-2000, 07:46 AM
The key to the table should be date and item. That way Access will not allow duplicates to be stored.

bill crumpton
04-25-2000, 09:06 AM
I am sure I am being confusing, I want duplicates but not within the same date, but on different dates duplicate entries are fine. I want to restrict duplicate entries only to the same date. I have been trying to figure this out for 2 months now.

Carol
04-25-2000, 06:26 PM
The answer that Pat Hartman gave is correct. Go back into your table and move your RecordID field and your DateField to one below the other. Highlight the first line and while holding the mouse button, move down to the next line and create 1 primary join key field. This will solve your problem.

Pat Hartman
04-26-2000, 06:40 PM
Thanks Carol. I must be loosing it. People keep having to interpret what I write.

bill crumpton
04-27-2000, 04:52 PM
I tried that Pat & Carol, however I do want to duplicate the field but just not on the same date. I may be the one confusing the question Pat but I do not want to be allowed to duplicate the same field on the same day but I do need to be able to select the field on the next day.

Pat Hartman
04-30-2000, 06:34 PM
Bill, if you make a compound primary key (that is a key comprised of 2 to 10 columns), you will be able to do what you need. Carol told you specifically how to do that.

You may be experiencing problems if you are also storing time information in the date field. The date field must be formatted as short date.

The other possible problem is that you have defined two distinct unique indexes rather than one compound unique index. Use the button bar (open the table in design view and choose the button with the lightning bolt) to show the indexes that are defined for the table and delete all except the primary key. Access has a feature that causes it to automatically define indexes on fields that contain certain key words. You can eliminate this behavior by going to tools/options-tables/queries tab and removing the autoindex values from the autoindex field.