Access assuming duplicate records in a form

T

Tammy

Hi,

I have a form containing subforms, which I have added to a tab control. I
separate the fields from one table across two tabs. The problem is this: when
I update info on one tab, and then go to the next tab, which contains
additional fields from the source I just updated on the previous tab, I get
the following message:

"The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship..."

I am not trying to add another record, just adding information to the
existing record. If I exit the record, and then return to it, I am able to
add the additional information.

How do I get Access to recognize that I am only updating an existing record
when I move to another tab, and not trying to create a new record using an
exisiting primary key?

Thanks for any help!
 
R

Ron2006

Hi,

I have a form containing subforms, which I have added to a tab control. I
separate the fields from one table across two tabs. The problem is this: when
I update info on one tab, and then go to the next tab, which contains
additional fields from the source I just updated on the previous tab, I get
the following message:

"The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship..."

I am not trying to add another record, just adding information to the
existing record. If I exit the record, and then return to it, I am able to
add the additional information.

How do I get Access to recognize that I am only updating an existing record
when I move to another tab, and not trying to create a new record using an
exisiting primary key?

Thanks for any help!

It sounds as if you have two different queires looking at the same
information. - the same record.

More typically when spreading data from the same record across two
tabs then the record source of the entire form is a single query, and
the different fields for that single record are placed on different
tabs.

Ron
 
T

Tammy

Hi Ron,

Thanks so much for replying. The subforms were created using a table, not a
query. All the fields were in one table, so there was no need to create a
query. I am using a different subform for each tab, but the source is the
same for each subform...am I totally missing something?
 
R

Ron2006

Hi Ron,

Thanks so much for replying. The subforms were created using a table, not a
query. All the fields were in one table, so there was no need to create a
query. I am using a different subform for each tab, but the source is the
same for each subform...am I totally missing something?








- Show quoted text -

I think that is the problem. By having the SAME record open twice
because of the TWO forms, I think you are causing the problem. See if
you can go back to what I was saying. Have the major form (it can be
a subform on an empty form - does not matter) but then just put the
fields you want to edit on the appropriate tabs. The only time I have
used full blown subforms on each tab was when they were looking at
related tables or at different queries that would pull different
records from the same table - not subforms pointing to the SAME
RECORD.

For instance,
I tend to make many forms in the following manner.
1) main unbound form with return buttons and other related title and
misc information
2) main bound subform that is bound to the record or table
3) on this subform I work out the layout of information that is common
to all tabs and also with a tab control
4) on each of the tabs I place the related fields and maybe even
another datasheet subform pointing to a subordinate table.
example: An account record bound to the form in total and on one
tab have order records and another payment records and another
phonelog with comments. and another address information from main
record and another more general customer information from that main
record. (Or sometimes I have the account information on the form and
all those other things on the appropriate tabs also on that form.)


Ron
 
T

Tammy

Okay, I will give it a try! Thank you very much for taking the time to answer
my question!
 

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