473,503 Members | 13,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error - The data has been changed

31 New Member
Afternoon all,

Cheers to anyone who can help! So far this forum has been a big lifeline to me!!

I believe this to be the last hurdle before my database is complete!

Problem - I have a main form with 3 subforms. Each subform is hidden until it is made visible through use of a check box (code has been written to only allow one box to be visible at any one time). These had been working perfectly but all of a sudden I have begun to get the error message

"The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes"

This is hard to believe as i am the only person using the database. I have found a few articles relating to this but no-one ever suggests a possible fix for this problem.

The Microsoft site says to fix the problem to add "Me.Parent.Requery" to the AfterUpdate event on the subforms. This does work but now when you try to change subforms using the check boxes, the 1st click on a check box appears to trigger the AfterUpdate but then you have to re-click the same check box to acctually change forms.

i.e. to change to Travel Subform from Cars you have to click the Travel Check Box, wait a second or two, and then click the Travel Check Box again to actually get it to change.

Seems a little pedantic i know but it just makes the form non user friendly.

Open to suggestions!! Cheers.
Nov 30 '06 #1
22 13263
MMcCarthy
14,534 Recognized Expert Moderator MVP
In Tools - Options under the Advanced tab.

Is your Default Record Locking set to Edited Record?

Is Open databases using record-level locking ticked?
Nov 30 '06 #2
philelpko
31 New Member
Default Record Locking is set to "No Locks"

The Open databases using record-level locking is ticked.
Nov 30 '06 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
Default Record Locking is set to "No Locks"

The Open databases using record-level locking is ticked.
Change Default Record Locking set to "Edited Record" and comment out the Me.Parent.Requery code. Does this solve the problem?

Mary
Nov 30 '06 #4
philelpko
31 New Member
Alas not,

Commenting out the Me.Parent.Request code allows me to switch between the subforms on a single click but I now get the error message again (Record locking changed to "Edited Record")

The subforms update perfectly well regardless of the error message. Is there anyway to disable certain error messages so the code carries on unhindered?

(cheers for the help)
Nov 30 '06 #5
MMcCarthy
14,534 Recognized Expert Moderator MVP
Alas not,

Commenting out the Me.Parent.Request code allows me to switch between the subforms on a single click but I now get the error message again (Record locking changed to "Edited Record")

The subforms update perfectly well regardless of the error message. Is there anyway to disable certain error messages so the code carries on unhindered?

(cheers for the help)
When you click the tickboxes are the subforms just switching from invisible to visible?
Nov 30 '06 #6
philelpko
31 New Member
Yes, the check boxes only change the visible state from true -> false (or vice versa). On the main form the 3 subforms are on top of one another. I read articles about over laying. Half said dont do it, the other half said its fine as long as you dont need to change the layout later.
Nov 30 '06 #7
MMcCarthy
14,534 Recognized Expert Moderator MVP
Yes, the check boxes only change the visible state from true -> false (or vice versa). On the main form the 3 subforms are on top of one another. I read articles about over laying. Half said dont do it, the other half said its fine as long as you dont need to change the layout later.
I've used a similar procedure before. The record shouldn't be trying to update just because the subform is going invisible.

Are your tickboxes based on a option group or are they individual?
Nov 30 '06 #8
philelpko
31 New Member
The tickboxes are individual
Nov 30 '06 #9
MMcCarthy
14,534 Recognized Expert Moderator MVP
The tickboxes are individual
Can you post the code for one of the tickboxes with the Me.Parent.Requery included.
Nov 30 '06 #10
philelpko
31 New Member
Here is the code I am using to control the check boxes

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub CarSelect_Click() 
  3.  
  4.    If CarSelect = True Then ' tickbox3
  5.       SubGeneral.Visible = False ' subform1
  6.       GeneralSelect = False ' tickbox1
  7.       SubTravel.Visible = False ' subform2
  8.       TravelSelect = False ' tickbox2
  9.       SubCar.Visible = True ' subform3
  10.    Else
  11.       SubCar.Visible = False ' subform3
  12.    End If
  13.  
  14. End Sub
  15.  

This code is located in the main form.

I deleted the "Me.Parent.Requery" code. The Me.Parent.Requery code was on the subforms unlike the check box code.

p.s (finishing for the day, so wont reply for an hour or 2)
Nov 30 '06 #11
philelpko
31 New Member
I deleted the "Me.Parent.Requery" code. The Me.Parent.Requery code was on the subforms unlike the check box code.

p.s (finishing for the day, so wont reply for an hour or 2)

Forgot to mention, that was the only code on the subforms
Nov 30 '06 #12
MMcCarthy
14,534 Recognized Expert Moderator MVP
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Private Sub CarSelect_Click()
  2.  
  3.    Me.Requery
  4.  
  5.    If CarSelect = True Then ' tickbox3
  6.       SubGeneral.Visible = False ' subform1
  7.       GeneralSelect = False ' tickbox1
  8.       SubTravel.Visible = False ' subform2
  9.       TravelSelect = False ' tickbox2
  10.       SubCar.Visible = True ' subform3
  11.    Else
  12.       SubCar.Visible = False ' subform3
  13.    End If
  14.  
  15. End Sub
  16.  
Nov 30 '06 #13
philelpko
31 New Member
No luck, it doesnt get rid of the error message.

I put a few breaks into the code (I have put the Microsoft code back in) to see what On Event procedures were running at what time.

When a subform is modified, and a check box is click on, the AfterUpdate event is triggered (as you would expect) and runs but then the On_click event doesnt trigger. I have tried clicking else where on the main form after modifying the subforms but it doesnt trigger unless another check box or combo box (on the main form) is selected.

Is there anyway to enter the Me.Parent.Requery style requery into the On_click event on the check boxes to requery the subforms without having to rely on the AfterUpdate event or is this not possible?
Dec 1 '06 #14
MMcCarthy
14,534 Recognized Expert Moderator MVP

Is there anyway to enter the Me.Parent.Requery style requery into the On_click event on the check boxes to requery the subforms without having to rely on the AfterUpdate event or is this not possible?
The first line in the code I sent you...
Expand|Select|Wrap|Line Numbers
  1.  
  2. Me.Requery
  3.  
Is the same thing. You don't need Parent because you're on the main form.
Dec 1 '06 #15
philelpko
31 New Member
The first line in the code I sent you...
Expand|Select|Wrap|Line Numbers
  1.  
  2. Me.Requery
  3.  
Is the same thing. You don't need Parent because you're on the main form.
Rather silly question of me to ask in hind sight!
Dec 1 '06 #16
MMcCarthy
14,534 Recognized Expert Moderator MVP
Rather silly question of me to ask in hind sight!
Don't worry about it.

More importantly, does it solve your problem?

Mary
Dec 1 '06 #17
philelpko
31 New Member
Don't worry about it.

More importantly, does it solve your problem?

Mary
Nope, still get the same data error message even with the Me.requery in the On_click event.

I think that I am going to have to re-do my main form but this time not hide the forms one behind another. What way would you recommend laying out a main form with 3 subforms (only 1 subform is allowed to be viewed at a time).

I think the main prob with this database is that its the 1st one i have ever designed and I keep finding quicker and easier ways to write code that I wrote the week before, so I am thinking of just re-writting the whole thing!!

Cheers for all the help Mary :)
Dec 1 '06 #18
MMcCarthy
14,534 Recognized Expert Moderator MVP
Nope, still get the same data error message even with the Me.requery in the On_click event.

I think that I am going to have to re-do my main form but this time not hide the forms one behind another. What way would you recommend laying out a main form with 3 subforms (only 1 subform is allowed to be viewed at a time).

I think the main prob with this database is that its the 1st one i have ever designed and I keep finding quicker and easier ways to write code that I wrote the week before, so I am thinking of just re-writting the whole thing!!

Cheers for all the help Mary :)
You could use a multi page object.

Before you scrap the idea completely, change your click boxes to command buttons. This is what I used when I was hiding/unhiding subforms. It may make a difference.

Mary
Dec 1 '06 #19
philelpko
31 New Member
You could use a multi page object.

Before you scrap the idea completely, change your click boxes to command buttons. This is what I used when I was hiding/unhiding subforms. It may make a difference.

Mary
Mary you are a god send!!!

I never have tried changing the check boxes to command buttons as i figured it wouldnt make any difference as the both worked on "on click" events.

Works a treat now!! Thanks massively.
Dec 1 '06 #20
MMcCarthy
14,534 Recognized Expert Moderator MVP
Mary you are a god send!!!

I never have tried changing the check boxes to command buttons as i figured it wouldnt make any difference as the both worked on "on click" events.

Works a treat now!! Thanks massively.
At a guess I would say with the tickboxes Access was attributing values to them whereas it doesn't with command buttons.

Mary
Dec 1 '06 #21
NeoPa
32,557 Recognized Expert Moderator MVP
Fascinating thread.
Who would have thought Access would behave so unpredictably ;)
Nice work getting it sorted out - particulary Mary.
Dec 1 '06 #22
Really Fascinating,
I have a same sort of problem but I do need Checkboxes, since they do Hold Information.

I have a subform with analising results, which is initially filles with default values. The checkbox tells me wether to print the results.

When I Re-analyse, the new records are added to the list, and I need the checkboxes to be copied to the newest results. All goes well so far...
Then I need to remove the older results from the report, and run a query that unchecks the checkboxes on the older records. At the end of this routine I requery, to update the form and I get the same erroromessage as Philelpko...

I tried in-code SQL vs Access-Queries for it was documented somewhere on the internet as a problem between access and sql regarding interpretation of booleans (-1 vs 1), no result.

Any more suggestions without changing the checkboxes???
Sep 30 '10 #23

Sign in to post your reply or Sign up for a free account.

Similar topics

2
9198
by: Bill Short | last post by:
Hello All, I have a popup form that is called from a command button on the main form. The main form's data source is tblA. The data source for the popup form is a query that is based on tblA. ...
8
11989
by: markus_fried | last post by:
Hi, we're using Access97 as frontend to a Oracle db. In Access we have a bound form which is using a Dynaset as source, global locking and form locking is off. All worked well until...
2
15399
by: RC | last post by:
I am getting the following error message. "Write Conflict this record has been changed by another user since you started edting it. If you save the record, you will overwrite the changes...." I...
3
3597
by: Terri | last post by:
I'm getting the error message "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" This is the code...
12
10918
by: daniel | last post by:
Hi All, I have a form and VB code in Access. The code is like With rs .Edit !Field = 10 .Update End With
19
8251
by: Taras_96 | last post by:
Hi everyone, How do you detect that a form element has been changed? This thread: ...
7
16340
by: PW | last post by:
Hi, I have a form with unbound fields on it. The user selects a record from a recordset and I populate the unbound fields. When I try to change the unbound quantity text box, Access 2003 tells...
10
2600
by: Roger | last post by:
ms-access97 & sql server2005 two tables tblItem tblItemFeature form frmItem contains subform frmItemFeature each form is based on their respective table creating new record and filling in...
1
1899
by: TracySHC | last post by:
I noticed that the "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" message has been dealt with in...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.