Form refuses to open

F

FKlassen

Hello,

Every once in a while I have a form that just refuses to open and I get this message:

"The changes you requested to the table were not successful because they would create duplicate values in he index, primary key or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."

I can see nothing in the form opening procedure that should cause this.

When this happens I just delete the mdb file and replace it with a copy that I keep in a back-up folder. This is a "work around". I have tried to investigate the cause of the problem but have had no luck. Sometimes I make changes to the form or its code and neglect to make a back up - then when this problem occurs the changes are lost and I have to re-do them.

Does anyone have a clue what could be causing this behaviour?

Thanks.
 
A

Allen Browne

The message suggests that something is dirtying the form when it opens, i.e.
something is assigning a value to a bound control.

It could be a macro or event procedure associated with several events, such
as the form's Open, Load, Current, or Activate event, or the events of the
control that intially takes focus (e.g. Enter or GotFocus.) It could also be
a SetValue action in a macro, or assigning a value in VBA.

If you are absolutely certain that none of these apply, then you might like
to try a repair (addresses bad indexes), decompile (addresses bad VBA
binary), compact (dumps stuff marked for removal.) For details, see:
Recovery sequence - Standard steps to recover a database
at:
http://allenbrowne.com/recover.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Hello,

Every once in a while I have a form that just refuses to open and I get this
message:

"The changes you requested to the table were not successful because they
would create duplicate values in he index, primary key or relationship.
Change the data in the field or fields that contain duplicate data, remove
the index, or redefine the index to permit duplicate entries and try again."

I can see nothing in the form opening procedure that should cause this.

When this happens I just delete the mdb file and replace it with a copy that
I keep in a back-up folder. This is a "work around". I have tried to
investigate the cause of the problem but have had no luck. Sometimes I make
changes to the form or its code and neglect to make a back up - then when
this problem occurs the changes are lost and I have to re-do them.

Does anyone have a clue what could be causing this behaviour?

Thanks.
 

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