stop duplicate records being created.

M

myztiques

I have a table for OT(primary Key is ID that auto numbers) that the employee
goes in to a form and enter in the hours they are available to work for the
week and that does create a good record. The problem I am having is that if
the employee goes back in to make a change a new record is created with the
only the employee and week completed and the other fields blank.

The all the fields in the table are used in the form or subform. I have
tried to set up the form(main form) from the Table and a query. The subform
is created from a query. I can say that I am frustrated as this should be
simple in my mind and yet I am still working on this! urgh!!

So, basically, to clarify, we have a form that the employee opens and select
from the drop down the "week of" and "Employee Name". Then they go to the
subform and enter the amount of hours and then hit a command button to close
the form and save without prompt. This part works well...

Now the problem, if there is any chnages the employee goes into the same
form and when the week and employee is selected the previous information
comes up and whether they make any changes a new record is created with only
the name and week is completed and the remaining fields are blank regardless.

I am not sure if the problem is due to the subform but I do not know of a
better way for the form to show the information based on the week and
employee without requiring them to enter the information before the form
opens. The only reason why I did not want the employee to have to enter the
info before the form appears is that I want to avoid different dates or
misspelling whchc would create a new record.

At this point I am open to any suggestions and insight.

Help me please!!!!!!!
 
J

Jeanette Cunningham

Hi,
The current form and subform you have are adding a new record each time they
are used.
Create a separate search form. Employees search using their name and week
and press a button to open the details for edit.
To make a search form, take an unbound form and place 2 unbound combos and a
button on it.
The combos are used for searching and the button is used to open the details
form for edits.
The edit form could be a copy of the subform from above, but it would open
as a form, not a subform. Set its Data Entry property to No and its Allow
Additions property to No.
Post back if you need more details

Jeanette Cunningham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top