How to prevent a duplicate record from form

T

TracyG

I have a form/subform combo - the subform needs to allow a table entry
addition based on the linked fields from form/subform. It is allowing the
add - but I need to prevent the addition of any additional table entries -
basically once the user enters data on the form for that key- I need to
prevent the user from adding any more new entries. How can I do that?
 
J

Jeff Boyce

Are you saying that the table relationship is that only ONE related row
should be added? If so, could you describe your data structure a bit more?
With an example?

Jeff Boyce
<Access MVP>
 
T

TracyG

this is a form/subform/sub-subform combination.

For example - there's a project form (and table- key of project id) and then
a subform with the subproject (subproject table with keys of
project/subproject). The subproject form has a subform of task (related to
a Task table). Each subproject has a single task that is keyed in the table
with the project/subproject - There is only one task per project/subproject.

It is adding the Task with no problem, but it wants to add multiple tasks
and I need to prevent that.
 
J

John Vinson

Each subproject has a single task that is keyed in the table
with the project/subproject - There is only one task per project/subproject.

It is adding the Task with no problem, but it wants to add multiple tasks
and I need to prevent that.

Two suggestions:

- Since each Subproject has one and only one task, perhaps the Task
information could be included within the subprojet table.

- Or, you can create a unique Index on the subproject ID linking field
in the tasks table to prevent adding more than one record for that
subproject. This will be shown in the Relationships window as a one to
one relationship.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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