Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

Double entry

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Martinez - 17 Nov 2005 06:49 GMT

Hello,

I am recording or a user the number hours each employees worked each week in
Access.  For example:

Name        Days Worked     Week Ending Date
John Dull            4                   11/04/2005

My problem is that the user or I sometimes double count the employee.  How
can I code it so I don't enter John Dull twice?  Any tips will be
appreciated.  Thank you.
Allen Browne - 17 Nov 2005 07:13 GMT
Create a unique index on the employee + date.

1. Open your table in design view.

2. Open the Indexes dialog (View menu.)

3. Enter on the first blank row in the dialog, enter a name for the index
(anything you like) in the first column, and in the 2nd column select the
employee field name.

4. In the lower pane of the dialog set the Unique property to Yes.

5. On the next row of the dialog, leave the index name column blank, and in
the 2nd column select the WeekEndingDate field. The 2 rows of the dialog
will look something like this:
   EmployeeIdWeekEndingDate    EmployeeID
                                                WeekEndingDate

6. Save the changes.

This will prevent you from entering 2 records for the same person and date.

You probably don't have a field named "Name". That will cause interminable
problems if you do, because almost every object in Access has a Name
property. You probably have a table of employees with an EmployeeID (like
Northwind does).

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hello,
>
[quoted text clipped - 7 lines]
> can I code it so I don't enter John Dull twice?  Any tips will be
> appreciated.  Thank you.
Alex Martinez - 18 Nov 2005 06:27 GMT

Thanks Allen, worked like a charm.

> Create a unique index on the employee + date.
>
[quoted text clipped - 35 lines]
>> How can I code it so I don't enter John Dull twice?  Any tips will be
>> appreciated.  Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.