After return to same form Access thinks I am 2nd user

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an update form bound to a table. When entering data in the update form I get to a control for which I have to temporarily go to an unbounded form to establish a value. (The update form is still in the background.) After closing this unbounded form and upon return to the update form, I enter the calculated value in the control. However, when I try to save the record, I am told that another user has updated my record and I have the choice between putting the data on the clipboard or drop the changes. In other words, upon return I am considered a second user. This is no doubt because of the RecordsLock Property being set at No Locks. My question is this: is there anyway to get around this?
 
yes, before you leave the current form, or before you run any update code,
just flush out any pending updates, so then when you come back...it will not
have been modified by two people (well, actually...two processes!)>


just place a:


if me.Dirty = true then
me.Dirty = False
end if

The above will force the disk write...and you should be just fine. I make a
habit of doing the above most of the time when I leave a current form to go
to another...
 
Thanks for your suggestion. I have put your code before I leave the main form and go to the other form temporarily. When in the temporary form I make another change to the same table as the one used for the main form. Then I put your code before I leave the temporary form and return to the main form. I have no errors so far. However, two problems arise. First, the change made to the table from the temporary form is not recorded in the table despite your code. Second, after having returned to the main form, any change or addition I make there to the table data gives me the second user/process error when I try to save that data.
Before I used your code I had used the statement: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70. It essentially did the same thing described above. Any other suggestions

Thanks.
 
I forgot to mention that my main form is a data entry form. I have the same setup with a data update form that does not cause any problems.

Thanks
 
I discovered that the problem does not occurr when using an Entry Form bound to an Access Table but it does occurr when the Entry Form is bound to a table linked to an SQL Server, which is my situation.
 
Ah, big detail here!

You did not mention sql server.

You need to have timestamp fields (these are special sql fields) exposed to
ms-access. They allow and help ms-access to figure out what has been
updated.

In addition to the above, you need to check out the issue of null bits:

ACC2000: Write Conflict Error When You Try to Update Records in a Linked SQL
Server Table
http://support.microsoft.com/?id=280730
 
Back
Top