Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: Help with write conflict please..

    I really need your help to find the write conflict error. I've been working on it for days/weeks and still not sure what caused it or how I can fix it.
    I am using Access 2000 fe and SQL SERVER 7.0 as BE
    The subform is bound to a table.

    Could you please look @ my code
    Sub save_shipped_input()
    Dim save_shipping_history As New ADODB.Command
    Dim clear_temp_fields As New ADODB.Command

    Forms!edit_shipping_sched!shipping_sched_list_subf
    orm!cust_ord_qty.Locked = False

    With save_shipping_history
    .ActiveConnection = CurrentProject.Connection
    .CommandText = "spUpdate_shipping_sched"
    .CommandType = adCmdStoredProc
    .Parameters.Append .CreateParameter("ret_val", adInteger, adParamReturnValue)
    :
    .Execute , , adExecuteNoRecords

    End With



    If save_shipping_history.Parameters("ret_val").Value > 0 Then
    Forms!edit_shipping_sched!shipping_sched_list_subf
    orm!shipped_qty_remaining = Forms!edit_shipping_sched!shipping_sched_list_subf
    orm!shipped_qty_temp
    MsgBox "There is an error occurred in the record you have entered. Please write down the work order number and contact the IT Department.", vbInformation
    Else
    Forms!edit_shipping_sched!shipping_sched_list_subf
    orm!shipped_qty_remaining.Value = Forms!edit_shipping_sched!shipping_sched_list_subf
    orm!shipped_qty_temp.Value - Forms!edit_shipping_sched!shipping_sched_list_subf
    orm!shipped_qty.Value
    End If



    'calls subform_shipping_sched_list beforeUpdate event where write conflict occurred after executing the procedure
    Forms!edit_shipping_sched!shipping_sched_list_subf
    orm.Requery


    Call Form_edit_shipping_sched.enable_disable_form(True)
    'Call enable_disable_form(True)

    Call Form_edit_shipping_sched.prep_sched_input

    Forms!edit_shipping_sched!input_shipped_qtys.Capti on = "Enter Shipped &Qty's"


    Set save_shipping_history = Nothing
    ''Set clear_temp_fields = Nothing


    End Sub


    Subform

    Private Sub form_beforeUpdate(Cancel As Integer)

    Dim sq As Long, sqrm As Long, sqt As Long, update_qty_remaining As Long

    If Not IsNull(Me!shipped_qty) Then
    'If Me!shipment_complete = True Then
    If IsNull(Me!shipped_date) Then
    MsgBox "You entered a shipped quantity but did not enter the date it shipped on.", vbExclamation
    Me!shipped_date.SetFocus
    Cancel = True
    Exit Sub
    End If

    Else

    Me!shipped_date = Null
    Me!reason_code = Null
    Me!shipment_complete = False
    End If

    If update_qty_remaining = True Then
    If IsNull(Me!shipped_qty) Then
    sq = 0
    Else

    End If

    If ..
    Else ..
    End If

    If ..
    Else..
    ..
    End If

    Me!shipped_qty_remaining = sqrm - (sq - sqt)
    Me!shipped_qty_temp.Value = Me!shipped_qty.Value
    update_qty_remaining = False
    End If

    Call tts_reason_code 'write conflict occurred after executing this calling procedure

    End Sub

    My error code is this:
    "Write Conflict:
    The record has been changed by another user since you started editing it. If you save the record, you will over write the changes the other user has made.

    Copying the changes to the clipboard will let you look at the values the other user has entered, and then paste your changes back in if you decide to make changes

    [Save Record] [Copy To Clipboard] [Drop Changes]"

    I appreciate any assistance.


  2. #2
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    88
    What's the code for tts_reason_code?

  3. #3
    Join Date
    May 2002
    Posts
    395

    write conflict

    Thanks for your reply. I think I've got it working as least for now.
    Have a good day!

Posting Permissions

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