when switching between form and subform get a 'the data has been changed ... re-edit' (1 Viewer)

joe789

Registered User.
Local time
Today, 14:59
Joined
Mar 22, 2001
Messages
154
When switching between main form and subform get a 'the data has been changed ... another user edited this record ... re-edit'

Hi Folks,


I have an elusive issue with a set of forms I am trying to figure out. A main for with a tab control and a few tabs is opened and maximized via a command button. A user can successfully enter data into this form no problem; however, if a user clicks on a command button within that main form to open and maximize a subform, if the user then goes back to the main form, again via a command button, and changes something on the main form this is the error message they receive:

"Microsoft Access: The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record." OK

Interestingly enough, no other user is editing the record and this happens each and every time someone goes from the main form to a subform via a command button on the main form, then back to the main form from the subform with a command button and changes an item on the main form.
After the user selects OK from the error/warning prompt it allows them to change the values and save those values without any problem.
Is there a way I can fix this and if not can I cirvumvent the error message somehow ... this is a description of the design I am using:

Command button is clicked from navigation menu = main form is opened and maximized in normal mode.
Command button is clicked from main form = saves main form data (but does not close the main form), opens and maximized subform in normal mode based on where [ID]=[Forms1].[Main Form].[ID], maximizes sub form
Command button is clicked from subform to go back to main form = embedded macro close sub form save without prompt opens main form back up in normal mode (this form never really closes per se, it just re-opens to the same record where it left off which is what I want).

Any help would be greatly appreciated. I am testing this database app and the only thing I can find is this issue, so if I can fix it somehow or at least turn perhaps this error message off, I am set to go.

I appreciate any help,

Thank you very much,

Joe
 

joe789

Registered User.
Local time
Today, 14:59
Joined
Mar 22, 2001
Messages
154
Figured it out ... I needed to use 'BrowseTo' as opposed to 'OpenForm' in the macros because the form was never really closed per se it just lost focus ...
 

joe789

Registered User.
Local time
Today, 14:59
Joined
Mar 22, 2001
Messages
154
I guess I didn't fix it, now when I toggle between the main form and subform different records open whereas before, the way I want it, the same record remains ... woops ... so back to square on, anytime I switch between forms via a macro using the openform on an already existing open form and change data I get that 'another user has edited this record ...' error :banghead::banghead::banghead:
 

Simon_MT

Registered User.
Local time
Today, 14:59
Joined
Feb 26, 2007
Messages
2,176
Before you swap views try saving the record it you can.

Simon
 

joe789

Registered User.
Local time
Today, 14:59
Joined
Mar 22, 2001
Messages
154
Thanks Simon. I tried to save the record as the first step in the macro, the step before making the main form visible again and maximizing it ... it is still rendering that error. I looked thru all the macro keywords and cannot seem to find anything that might remedy this except perhaps GoToControl use instead of using OpenForm but that didn't work either. It is almost as if Access needs a few minutes and/or a keypress or two to error out saying someone else, which is really no one, is in that record before allowing the data to be saved again once you go from subform back to mainform on the main record ... I am lost.
 

joe789

Registered User.
Local time
Today, 14:59
Joined
Mar 22, 2001
Messages
154
Fixed it ... problem was I could not keep both forms open at the same time, although only one form was visible and maximized at a time, that is what was causing the issue ... I wanted to keep both forms open because that would have easily allowed me to stay on the current record in question because I was working with a separate but linked via PK table in both main and sub forms ... so I just closed out the form with the macros to only allow one open form at a time then just re-set the where clause using the record ID in the active form right before it closed to re-open the other form on the same record that the person left the other form at ... woo hoo
 

Users who are viewing this thread

Top Bottom