Error when press "Save Record" but not when record saves itself automatically

A

AndyCotgreave

Hi,
In my database, I have a CompanyID field. It is a string, but is the
primary key on my Companies table.

Tables that are related to the Companies table (People, Events, etc.)
have a one-to-many relationship with Enforced Referential Integrity.

The user is allowed to change the CompanyID, and this should change the
CompanyID field in all related tables.

If I change CompanyID on my main form, and then click on another text
box on the form, the ID field is changed, and the change cascades
throughout the tables.

BUT, if I change CompanyID on the form, and click "Save Record", Access
collapses and shuts down, and I need to repair the database. When it is
repaired, the changes have cascaded through fine.

As far as I am aware, moving focus to another control on a form should
do a SaveRecord command, but there appears to be some subtle
difference.

Any ideas?

Access 2003, Windows XP SP2

Thanks,

Andy
 
A

Allen Browne

What does 'click "Save Record"' mean?

Do you have a command button on your form?
If so, what is in its On Click property? In the macro/code this refers to?

Whatever it is, it should not crash Access, so there is something else going
on as well. Suggestions:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect

Then compact the database to get rid of this junk:
Tools | Database Utilities | Compact
Explanation of why:
http://allenbrowne.com/bug-03.html

2. You say this form has a subform?
What is in the LinkChildFields property of the subform control?
Do you have a text box with the name used in LinkChildField?
If not, add a text box to the subform.
(Set is Visible property to No if you wish.)
There is a bug in Access 2002 and 2003 where it can crash (shut down by
Windows) if LinkChildFields contains the name of an AccessField type object
(i.e. a field in the subform, not a control in the subform.)
 
A

AndyCotgreave

HI Allen,
Thanks for the prompt reply!

"Save Record" - by this, I meant the Save Record menu button - the
Access system button (same as pressing Shift+Enter)

I am just installing Office 2003 SP2 as I type this. I'll try out your
suggestions, and let you know if it fixes things.

Thanks
Andy
 
A

AndyCotgreave

Hi,
I tried all your suggestions, Allen but I still have the same problem.

I'm not sure what other light I can shed on the issue - do you have any
more suggestions?

I tried the ultimate measure of creating a new database and importing
everything into it. However, I got a message saying a macro was missing
(i didn't write down the name of the missing macro..doh!) - but it was
a macro i did not write, and one that does not seem to exist in the
database (could it be a system macro?)

Help!
 

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