Results 1 to 5 of 5
  1. #1
    Slush is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    38

    sub form write conflict error

    Hello. I have a sub form which displays patient address located within another subform (which displays patient name, phone #, contact dates, etc.). The address sub form should allow users to add or edit addresses. When I make changes to an address or add a new one I often get a write conflict error (even though I am the only person in the database). The error does not always appear (usually, but not always) and I can't figure out the cause of the error.

    The address sub form is based off of a query of the address table. The query seems to work correctly. I can edit records and add new ones in the query. The main form and other sub form do not include any of the address table's fields (aside from the foreign key- Pat ID DMS). The sub forms are linked using PAT ID DMS which is a foreign key in the pat address table.

    There are several bound combo boxes on the address sub form displaying values from look-up tables (such as direction, street type, etc). The patient address table has an auto number primary key. The database has a SQL Server backend with an Access 2013 front end. The pat address table has a row version field/time stamp.



    Below is a view of the address sub form and the record source query. The query is simple. It just pulls the fields from the patient address table and it seems to work correctly. I have tried adding code like the following to different controls: refresh, if me.dirty then me.dirty = false, and docmd.runcommand accmdsave record, but the problem remains. I'm not sure what else to try. Please help!


    Click image for larger version. 

Name:	AddressSubform.JPG 
Views:	12 
Size:	32.1 KB 
ID:	25884

    Click image for larger version. 

Name:	PatAddressQuery.JPG 
Views:	12 
Size:	66.5 KB 
ID:	25885

  2. #2
    Slush is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    38
    I am not sure but it appears to be an issue with the combo boxes. The combo boxes display values in the look-up tables such as direction, street type, county, etc. They are limited to list and are not required. Often no value will be selected or the user may look at the list and not choose any option (so there is no default value I can set). I seem to get the error regardless of if a valid value is selected or if the cell is clicked in and no value is selected.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Can you post a copy of the database with directions on how to invoke the problem/issue?
    We don't need real data, but some sample records. If not, then a jpg of your tables and relationships may help.
    You might tell us in simple, plain English what you are trying to do --that is the purpose of the database and the business facts it will support.

    A quick look suggests it is quite detailed info and could be an issue for keeping things current---but then again, I know nothing of your environment nor application.

  4. #4
    Slush is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    38
    I can't provide a copy of the database. Below is a jpg of the relationships of tables included on these forms and a screenshot of most of the form. (I cut out a list box on the main form displaying patient names). The database is tracking patient information and contact with patients, physicians, and facilities. The forms in question are tracking patient contact information (phone number, address, email) and attempts to contact the patient (was a letter mailed or a phone call made).

    The main form, along the top of the image, contains patient name, study, and demographic information. The contact tab contains a sub form with the patient name, phone number and another sub form with the patient's addresses. Patients may have many addresses. The address sub form is linked to the contact sub form by PAT ID DMS. This is the primary key in the patient table and a foreign key in the address table. The address sub form record source is a simple query which pulls the information from the patient address table.

    The address sub form is the problem. All other forms are working correctly. The address sub form should allow users to view, edit and add addresses. When I select an item in the combo boxes I receive the write error. The combo boxes are allowing the user to select the county, street type (ave, str, alley), and direction (N, S, NW...). The combo box row sources are select statements which display the values from look-up tables and the control source is the appropriate field in the address table. (see screen shot)

    Currently, the combo boxes have no events tied to them. I tried various save, requery or refresh code, but it did not help. I'm not sure if I did not write the code correctly or if the issue is related to some other problem. I appreciate any suggestions.

    Click image for larger version. 

Name:	relationships.JPG 
Views:	9 
Size:	193.6 KB 
ID:	25889Click image for larger version. 

Name:	Combo.JPG 
Views:	9 
Size:	103.9 KB 
ID:	25890
    Attached Thumbnails Attached Thumbnails ContactForm.JPG  
    Last edited by Slush; 09-23-2016 at 01:54 PM.

  5. #5
    Slush is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    38
    I have the write conflict error when editing records directly into the patient address table, so this does not appear to be a form issue. I have 2 bit fields (yes/no) with a default value set to 0. I know these can cause an issue if they have null values, but they do not allow nulls. I will look at changing these to small integer datatype. The table has a row version in SQL Server, so I am not sure what else to try. I refreshed the linked tables.

    (I would move this from the form section of the forum or delete it, but I am not sure how to do this. )

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

Similar Threads

  1. Replies: 21
    Last Post: 09-16-2016, 08:44 PM
  2. write conflict error
    By nyneave in forum Security
    Replies: 1
    Last Post: 10-13-2012, 06:17 PM
  3. Replies: 3
    Last Post: 08-06-2012, 03:29 PM
  4. write conflict error
    By karuppasamy in forum Access
    Replies: 1
    Last Post: 06-07-2011, 12:23 PM
  5. Write Conflict Error
    By botts121 in forum Access
    Replies: 5
    Last Post: 09-25-2009, 12:11 PM

Tags for this Thread

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