Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Access

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-24-2006, 10:05 AM
Novice
 
Join Date: Aug 2006
Posts: 2
horseyshoe
Default 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.
Reply With Quote
  #2  
Old 08-25-2006, 02:14 AM
Novice
 
Join Date: Jun 2005
Location: Northampton, England
Posts: 14
Tanis
Default

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.
Reply With Quote
  #3  
Old 08-31-2006, 06:51 AM
Novice
 
Join Date: Aug 2006
Posts: 2
horseyshoe
Default

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!!!
Reply With Quote
  #4  
Old 09-01-2006, 05:51 AM
Novice
 
Join Date: Sep 2006
Location: Manchester, England
Posts: 13
DanInManchester
Default

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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate command button brettg Database Design 1 08-04-2008 02:16 AM
Which duplicate? grgerhard Import/Export Data 1 05-27-2006 04:19 AM
duplicate autonumber rayc Access 0 01-16-2006 06:57 AM


All times are GMT -8. The time now is 02:43 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.