Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Posts
    2

    Duplicate add to new table

    Hi all!!!



    As a somewhat yet capable newbie I have a question on how to accomplish something...

    I have a table that is populated by numbers that are entered in a form. When the add process is taking place it first checks to see if the data that is trying to be added is already in the table and if it is it pops up an error message and won't let the data be added. What I need to further enhance this is for the duplicate info that is trying to be entered to be saved in another table along with displaying the error message so that the user knows it was a duplicate.

    Any thoughts?

    Thanks in advance for any and every one's help.

  2. #2
    Join Date
    Jun 2005
    Location
    Northampton, England
    Posts
    14
    The short answer is no. Why would you want to anyway? If you want to know who added, changed or deleted records, why not have a log file? What is your code for trapping duplicates? Perhaps a message in that routine would be better.

  3. #3
    Join Date
    Aug 2006
    Posts
    2
    What I am trying to accomplish is this...

    What I want to use Access for is to track entry to a limited access area utilizing a card swipe. The goal is to allow a person to gain admittance to this limited access area once per day. So I have everythign set up so far to record to a table the first time a person goes in to the area. If that person tries to go to the area again I want a message box to pop up to alert the person that is manning the entrance that the guest is accessing the lounge a second time in a given day. I have that part figured out as well. The part that I am having an issue figuring out is that along with alerting the person manning the entrance I want a list kept of the persons that tried to access the area multiple times in a given day in a seperate table.

    Thanks for any help!!!

  4. #4
    Join Date
    Sep 2006
    Location
    Manchester, England
    Posts
    13
    You could do it the way you are doing it but I would suggest a better way thatis more scalable....

    tbl_User
    UserId (PK)
    Fullname

    tbl_AccessLog
    AccessLogID (PK)
    UserId (FK)
    Denied (boolean)
    DateTime


    Code:
    SELECT Count(AccessLogID ) as NumberOfAccesses
    FROM tbl_AccessLog
    WHERE UserId = 123 and denied = false and datetime=#01/09/2006#
    then if you get a 0 count allow access and do a insert like so :
    Code:
    INSERT INTO tbl_AccessLog (UserId,Denied) VALUES (123,false)
    or if you get 1
    Code:
    INSERT INTO tbl_AccessLog (UserId,Denied) VALUES (123,true)
    that way you log all attempts and can set the number off accesses you allow per user and all sorts.

    Hope that helps

Please reply to this thread with any new information or opinions.

Similar Threads

  1. duplicate autonumber
    By rayc in forum Access
    Replies: 5
    Last Post: 06-19-2013, 07:50 AM
  2. Duplicate command button
    By brettg in forum Database Design
    Replies: 1
    Last Post: 08-04-2008, 04:16 AM
  3. Which duplicate?
    By grgerhard in forum Import/Export Data
    Replies: 1
    Last Post: 05-27-2006, 06:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums