473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table entry comparison

34 New Member
Hello again,

I am having problems in designing a (hopefully) simple, I think it would be a query. Here is the issue:

I have a table that tracks time spent on specific tasks. It only hase a few fields, but the two that matter are [Name] and [Date]. The table is filled from a form. What I want to do is prevent multiple entries from being submitted for any given day via any given name. Example:

Doe, John made an entry for 01/01/2010, later he came and entered a new entry for the same date. Both entries were saved with unique ID (Primary Key) numbers and when running the reports shows in the totals.

What I would like is for it to either deny the second entry (prefered method), or update the original entry with the new data instead of creating a new (unique) entry.

Can anyone help me?
Sep 24 '10 #1
8 1751
Mariostg
332 Contributor
You can modify your table structure to have two fields as primary key. In the table design click on the very left section (it's grey) on your Name field. Hold down Ctrl key then select the Date field. When both field's row are selected click the primary key button.
Sep 24 '10 #2
MOCaseA
34 New Member
Unfortunately you suggestion did not work... I have to allow for duplicate name and date entries (40 employees over several days) with unique identifiers. I tried multiple combonations of allowing/disallowing duplicates and it still allows me to create multiple entries on the same date with the same name, or doesn't allow me to make multiple entries with either same name/different date, or different names/same date.
Sep 24 '10 #3
Mariostg
332 Contributor
I probably don't understand what you try to achieve. Your last reply seem to contradict your first one. When you say "I have to allow for duplicate name and date entries" yet in the first one yousay "What I want to do is prevent multiple entries from being submitted for any given day via any given name"
So my understand was that you cannot have John Doe - 1 Sep 2010 twice...
Sep 24 '10 #4
MOCaseA
34 New Member
Correction... I was including the ID in the PK as well which was throwing things out of whack. Fixed it though. Thank you!
Sep 24 '10 #5
OldBirdman
675 Contributor
I do not like to contradict Mariostg, but I think they intended to create an index with two fields, not a new primary key. Apologies if I'm wrong.

In design view for the table:
1) Put the Primary key back to what it was (AutoNum field? or ...). Create a new index using both [Name] and [Date] field

2) From the 'View' menu, choose 'Indexes' and in the first blank row, type a name, like NameDate, then in the Field Name column, click the arrow and select the first field for the index (Name).
In the next row in the Field Name column, select the second field for the index (Date). (Leave the Index Name column blank in that row.)

3) In the footer, set Primary = No and Unique = Yes. Close the window. If the new index isn't unique in the table, this will fail until you start with these two fields unique when combined.

A further comment: "Date" is a reserved word in Access. Although there is no conflict with a field name, eventually something will go wrong, and you will struggle to find out what. Change to something more meaningful to the database, like "TaskDate"
Sep 24 '10 #6
MOCaseA
34 New Member
Actually what Mariostg recommended worked perfectly. I know that Date is a reserved word, as is Full Name (another table) and a few other of the fields I'm using across 18+ tables. It actually works quite well as a few of the functions I'm using to propegate data have these reserves in place and save me a lot of headaches. Only once have I run across and issue with the reserve interfereing and it was a relatively easy work-around to fix it.
Sep 24 '10 #7
OldBirdman
675 Contributor
Not sure I understand your reasons, but if it works for you, it works for me. Just thought that "BTW... I'm a coding "dummy" " might mean you wanted suggestions along with solutions.
Sep 24 '10 #8
MOCaseA
34 New Member
This wasn't so much a coding issue as it was an unfamiliarity with Access primary keys (I've never had to use more than one field as a key before, so I learned something new).
Sep 24 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2150
by: Acorn Tutors | last post by:
Hi folks, what I would like to do is to store the name of a link, such as link1.php in a field, lets say the field is called Favoritelinks, in a database as a bit of text. Then, on a logged in page, pull the value from the field and put in right in the <a href><a> tag so that the link now points to a file, and is dynamic. And, depending on the...
1
5579
by: RobertGl | last post by:
Hi everybody! My problem is as following: I have a trigger which fires on delete of a table row. The body of the trigger checks and manipulates entries in other tables. If the entries have certain values, I would like the row of the table which has fired the trigger not to be deleted. As far as I understood this problem could be solved...
2
1884
by: Robert Oschler | last post by:
I'm running MySQL 4.0 on SuSE Linux 7.3 Pro. I accidentally granted priveledges to a user with the following user label, quotes are part of the user label: // NOTE: replace with @, this was done to keep the mail client from turning it into a "mailto:" link. "someuser180.150.2.%" I did this by enclosing the entire user label in quotes...
0
1166
by: bbrazeau | last post by:
Greetings, I am developing a database that tracks our products life cycle. It has a table with a memo field for describing revisions to the product. I have a form (form1) for entering revision descriptions that writes to a new record in the table, the form only allows the user to select products from a combo box (populated with exsisting...
1
2161
by: geepeetee | last post by:
Hi My daughter is creating a db for some homework (age 13) is there an easy way to link a photo so it shows with the form entry or datasheet. thanks Gary
3
1843
by: larry | last post by:
Ok I am re-coding our apps in PHP and am looking for ways to make parts easily updateable, One of the challenges in my field (non-rpofit) are various lookup tables (for incomes etc). An example table would be something like a rate lookup, where you travel down the family size column and when you reach the right income you look for the...
0
1619
by: Howie | last post by:
Hi all. Hope you can help. I occasionally need to enter info directly into a table. However, when I do, I often need to enter the same value into a large number of fields. It would be nice if I could: copy, highlight the top, say - 50 fields in a column, and then paste the same value into all of them in one stroke. However, Access 2003...
5
1775
by: Addy Smith | last post by:
I have 2 tables with different versions in access. Both are same but the latest version obviously has some new records and some deleted records from the previous version. How would I compare the new table with the old one? I have a common field called MFI_ID having the value AT00100, AT10000 etc, in both the tables. I need to put the query and...
0
1218
by: pravin gawande | last post by:
Hi Folks, I wanted to put check for the existing table. I got the table entry in two different tables. 1. SYSCAT.TABLES 2. SYSIBM.TABLES
11
2468
by: gixxer5 | last post by:
Okay here goes, I have 3 tables Person_ID: text; first_name: text; last_name: text;
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.