Results 1 to 2 of 2
  1. #1
    GbJubes is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    3

    Database access

    I have a field in a form that I can change using the code below. At first this field worked fine. Now I get a 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 message does not appear every time I edit the record and I can't figure out why the message comes up as there are not other users using the data base.
    Can someone tell me why?

    Dim Dbs1 As Database
    Dim rst1 As Recordset
    Set Dbs1 = CurrentDb()
    Set rst1 = Dbs1.OpenRecordset("General Ledger")

    rst1.Index = "GLCode"
    rst1.Seek "=", GLCode
    If rst1.NoMatch Then
    MsgBox ("GL Code Not Found...!")
    Else
    rst1.Edit


    rst1!PayrollCode = Me.PayrollCode
    rst1.Update
    End If
    rst1.Close

    Thank you,
    Gerry

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Presuming the form is bound to the same table/record that the recordset is updating, the other user is you. Typically you would only use a recordset to update data if the form you're using it on is not bound to the same table (or isn't bound at all). In other words, bound form or recordset; not both.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. new to access need help on database
    By Miketallica in forum Access
    Replies: 1
    Last Post: 04-27-2010, 07:03 AM
  2. Using ADO get access database name
    By sridhar in forum Database Design
    Replies: 1
    Last Post: 01-30-2010, 09:56 PM
  3. Scheduling database in Access
    By ACS Newbie in forum Access
    Replies: 4
    Last Post: 01-21-2010, 10:32 PM
  4. Using ADO get access database name
    By sridhar in forum Programming
    Replies: 0
    Last Post: 11-14-2009, 06:18 PM
  5. Access Database become inaccessible
    By samjoseph in forum Access
    Replies: 2
    Last Post: 07-01-2009, 01:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums