Odd behaviour

G

Guest

Hello,

Something weird happened to me - I have a form with continuous subforms and
on it are checkboxes. When I click on one specific checkbox, a text box on
the parent form becomes visible, where I can add text, which is added
directly to the table in the AfterUpdate event.
However, the query underlying the subform does not reflect the change, and
when I either go to a different record on the parent form, or click on
another checkbox in the subform, I get an error message:

"This record has been changed by another user since you started editing it.
If you save the record, you will overwrite the changes the other user made.
[...]"

I can then Save The Record, Copy To Clipboard or Drop Changes.

When I drop changes, the text shows up in the query, although my textbox
disappears.

The one time I selected Save, however, the query got messed up and a foreign
key was replaced by what looks like random number [used to be "1", is now
"4587525"].

Can anybody explain this?
And, more importantly, suggest a way to avoid this entire situation?

Thank you.
 
J

Jeff Boyce

?Any chance the underlying data is stored in a SQL-Server database, rather
than in an Access/JET database?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

No, this is strictly an Access db.

I did use DoCMD.RunSql to run an update query to move my text into the db,
but I'm not sure that's relevant.

Jeff Boyce said:
?Any chance the underlying data is stored in a SQL-Server database, rather
than in an Access/JET database?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Niniel said:
Hello,

Something weird happened to me - I have a form with continuous subforms
and
on it are checkboxes. When I click on one specific checkbox, a text box on
the parent form becomes visible, where I can add text, which is added
directly to the table in the AfterUpdate event.
However, the query underlying the subform does not reflect the change, and
when I either go to a different record on the parent form, or click on
another checkbox in the subform, I get an error message:

"This record has been changed by another user since you started editing
it.
If you save the record, you will overwrite the changes the other user
made.
[...]"

I can then Save The Record, Copy To Clipboard or Drop Changes.

When I drop changes, the text shows up in the query, although my textbox
disappears.

The one time I selected Save, however, the query got messed up and a
foreign
key was replaced by what looks like random number [used to be "1", is now
"4587525"].

Can anybody explain this?
And, more importantly, suggest a way to avoid this entire situation?

Thank you.
 
G

Guest

Ok, looks like I figured it out.
It was, as is so often the case, a problem caused by the human element. :)

I have more than one textbox on my main form that I wanted to insert text
into the table, but I guess trying to update the table directly is a bad idea
in such a case.
Now I'm updating the queries my subforms are based on, and there is no
conflict anymore.
I still find it very odd that my one Save attempt lead to the corruption of
the keys, but oh well, I'll delete all the data anyway once I'm done with my
forms; it's just for testing things now.
 

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