Preventing duplicates is hindering date/time stamps


Board Regular
May 12, 2005
I have a data entry form that tracks employee work date, start and end time (and other data) that opens to blank form only to prevent users from seeing anyone else's records. I've setup the start & end time fields (after update property) to log the system date/time in hidden fields. I setup the form to prevent duplicates based on the work date & user name (2 primary key fields). The problem is that the user is required to log their name, work date & start time at the beginning of their shift & their end time at the end of their shift. If the form only opens to a blank form and no duplicates are allowed, how can they enter their end time at the end of their shift. I have an edit timecard form that opens their previous timecards in datasheet view that they can edit previous cards but if they use this, the system date/time will not be stamped on the End Time field. Any suggestions on how to work around these options? Perhaps a way for the user to only open their records when they access the main time entry form.


MrExcel MVP
Aug 5, 2003
One option is to have a field called CreatedBy, which is automatically stamped with the user's name. In the Default Value property for the field in table design view, put =Environ("username"). This will insert the user's Windows login name in the field.
When the form opens, you can filter it to display only records where this field matches Environ("usename").


Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...