Link to home
Start Free TrialLog in
Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on

Avoiding Write Conflict message...

I have a drop-box on a main form. There is a subform on the main form.

After update of the drop-box on the main form, the following code update the recordsour-table of the subform:

    
    CurrentDb.Execute "Update tOwnerDRF_Titles Set BU_ID=" & Me!cboBusinessUnit & " Where OwnerDRF_ID=" & Me!OwnerDRFID
    
    'Me!sfDRF_TitlesTempUpload.Form.Dirty = False
    'Me!sfDRF_TitlesTempUpload.Form.RecordSource = Me!sfDRF_TitlesTempUpload.Form.RecordSource

Open in new window


However, When I go from one record on the main form, I get "Write Conflict" message which I am trying to avoid. Additional information is provided on the attached image.

Question: How can I get rid of the "Write Conflict" message?

Thank you.
writeconflict.png
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

You can't really avoid the WC message. However, you can trap those error codes - and that error is only rendered in the Form Error event.  There, you can display any message you want to the user.  However, the standard WC message is already pretty good ... and generic Microsoft error messages go.

mx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Eghtebas

ASKER

Thank you.
Are the master/child links set on the subform?

If all the combobox on the main form does is filter the records in the subform, then you can even use the simple code the wizard creates:

    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CustID] = " & Str(Nz(Me![cboCustID], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

JeffCoachman