Results 1 to 4 of 4

Thread: write conflict

  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Talking Unanswered: write conflict

    I wrote the codes for modify the records in my Table as follows:Private

    Sub Save_Click() 'save after editing
    Dim xSQL As String
    Dim Fname As String
    Dim LID As Integer

    Dim rs As ADODB.Recordset
    DoCmd.SetWarnings False

    Set rs = New ADODB.Recordset
    With rs
    .ActiveConnection = CurrentProject.Connection
    .CursorType = adOpenKeyset
    .LockType = adLockOptimistic
    .Open "tbl_Fresheyes", CurrentProject.Connection
    Do While Not .EOF
    If !ID = Me!ID Then
    DoCmd.SetWarnings False
    !ID = Me!ID
    !Location = Me!Location
    !ModelYear = Me!ModelYear
    !VehicleLine = Me!VehicleLine
    !VehicleBuild = Me!VehicleBuild
    !SystemName = Me!SystemNameonform
    !PhotoNo = Me!PhotoNoonform
    !Class = Me!Classonform
    !Design = Me!CheckDesignonform.Value

    !Process = Me!CheckProcessonform.Value
    !Quality = Me!CheckQualityonform.Value
    !VehicleA = Me!CheckVehicleAonform.Value
    !VehicleB = Me!CheckVehicleBonform.Value
    !VehicleC = Me!CheckVehicleConform.Value
    !VehicleD = Me!CheckVehicleDonform.Value
    !VehicleE = Me!CheckVehicleEonform.Value
    !VehicleF = Me!CheckVehicleFonform.Value
    !RepeatedIssue = Me!RepeatedIssueonform
    !SDS = Me!SDSonform
    !ReviewDate = Me!ReviewDateonform
    !CPSName = Me!CPSNameonform
    !CPSCDS = Me!CPSCDSonform
    !Concern = Me!Concernonform
    !Responsibility = Me!Responsibilityonform
    !Engineer = Me!Engineeronform
    !AIMSNumber = Me!AIMSNumberonform
    .Update
    DoCmd.SetWarnings False
    End If
    .MoveNext
    Loop

    End With
    DoCmd.SetWarnings True

    when i click the save button. my modified record can be saved but I got the write conflict message , it is strange , coz i already modify it to my table, why it does not allow me to save it? Please give me a hand!

  2. #2
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179

    Re: write conflict

    Try inserting the .Edit line (bolded)
    Code:
         DoCmd.SetWarnings False
          .Edit
         !ID = Me!ID
    Hope that helps!
    JT

  3. #3
    Join Date
    Aug 2003
    Posts
    2
    why I do not have .edit and only have the .editmode

  4. #4
    Join Date
    Aug 2003
    Location
    Bosnia & Hercegovina
    Posts
    57
    are fields on your form linked to table or query for row source or you fill them with ADO?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •