Hariharan Iyer
Hariharan Iyer

Reputation: 19

Access Form having Write Conflict issue when checking a checkbox in a form

I have an Access form where users can add new phone numbers for a client. So the form works in the following ways:

  1. There is a main form called Update Client Details which contains a subform called Update Phone which shows the list of phone numbers the Client has. Following are the fields in the form:
[cID][FullName][PhoneType][PhoneNumber][Active]
1     Test ter   Mobile     0899955522    []<=(blank check box)
  1. There is an Update button on the form that opens a new form where users can add a new phone number for the client.

  2. When the user adds a new phone number, the phone number is displayed in the Update Phone subform with Active being 0 by default (Active is a checkbox field).

  3. Whenever I click the checkbox to make the phone number active I receive the write conflict error.

Please find the attached image:

WriteConflict

I'm the only user currently working on the database. Can someone please help me solve the issue? Thank you all in advance.

UpdatePhoneSubform

AddNewPhoneNumber

Back to Update Client Details form where new number is shown in Update Phone subform

Wherever trying to check the checkbox it's giving the write conflict error

Upvotes: -1

Views: 139

Answers (1)

A.J
A.J

Reputation: 45

write conflict happen when two users open same table exclusively , when you click update your table is a record source for the two forms.

solution:

1- Make clients list Form Record Source as Query not Table.

2- make the client relation's phone update Form to Unbounded Form with un bounded controls

and use following code to perform update when you click Save and Close

CurrentDb.Execute "UPDATE [Your Table Name ] " & _
"SET [Client Phone Field] ='" & [Phone Number Text Box] & "' " & _
"WHERE [Client ID Field ] = '" & [Your Client ID Text Box] "'"

Upvotes: 0

Related Questions