473,387 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I avoid duplicate data entry?

Hello,

I have a form that i need operators to fill in with how many hours they worked that day (they enter the date, their name and the hours). They have been entering the data more than once, which really messes with my calculations. I have been trying to use a before update event in my Hours textbox with a message box telling them that they already entered the data and cancelling the entry, but i cant get it right. This is what I have: (please bear with me i'm a total newbie)

Private Sub Hours_BeforeUpdate(Cancel As Integer)
Dim icount As Long
icount = Nz(DLookup("Hours", "Inspectors' Hours", "Hours=" & Me.Hours), 0)
If icount <> 0 Then
MsgBox "You have already entered your hours for today."
Cancel = True
Undo
End If
End Sub

Thank you for your time!!
Oct 5 '10 #1
1 1838
Mariostg
332 100+
Create a primary key using two fields: name and hours. See my post here:
http://bytes.com/topic/access/answer...on#post3606144
Oct 6 '10 #2

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

Similar topics

1
by: Randy | last post by:
I am using Approach 9.8 and have set up a appointment database with the following fields. DATE, TYPEACTION, TIME, WORKER LASTNAME FIRSTNAME I do not want my clerical staff to be able to key in...
6
by: Wayne | last post by:
I am designing a database which needs approximately 50 fields per record. The database user requires data entry to be via a single screen. If I follow good database design practice and split the...
5
by: Darrel | last post by:
I have a web form that inserts a record into a DB. This function is called from the button_click subroutine. After the record is inserted, I show/hide some different panels and let the page...
0
by: hrh1818 | last post by:
What type of control would you suggest for use in entering numeric data in a 4 column by n row data entry table. The number of rows n can vary from 3 to 20 and will be detrmined at run time. The...
1
by: nanie | last post by:
i am new in vb. i would like to know the vb script for detect duplicate data entry. this is the system for booking bus.the bus have unique number.nobody can book the same bus.the system will give the...
5
by: mercea | last post by:
hi all, How do i avoid duplicate records on my database? i have 4 textboxes that collect user information and this information is saved in the database. when a user fills the textboxes and clicks...
1
by: oaklander | last post by:
I would like to make sure there are no duplicate data entries in my Oracle 9i table (called MainTable) which has an Id field that is the primary key, ValData with a varchar data type, Fid and Fid2...
8
by: adigga1 | last post by:
I am building a Patient Medical Billing Database and I will be entering duplicate information from time to time, such as, entering a patient that has received a Chest X-ray twice or three time on...
1
by: admin.offshoredataentry | last post by:
Data Entry Outsourcing provides time bound, cost effective and qualitative Data Entry also provides numeric data entry, textual data entry, image data entry, data format, data conversion and also...
1
by: Rocker1 | last post by:
Hello guys, I am reading a downloaded textfile which has a fields like date,NAV and Name using VB.NET. The date on which the textfile is downloaded remains the same.After each readline operation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.