0
votes

I currently have an MS Access 2016 Application that I am running on a shared network. The front end is an ACCDE file saved in a shared folder with the backend saved in a subfolder of that same folder (anyone with access to the front end has access to the back end). I am having users create a shortcut on their desktop to access the Front End. This allows me to make minor updates without requiring everyone to download the newest version. Most features of the tool work fine. However I keep running into an issue on one of the forms. I have a Before Update event, when you navigate away from the record, the system will ask you if you would like to save. If you click yes, the following error message comes up:

"The expression Before Update you entered as the event property setting produced the following error: the Save Action was cancelled.
This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs."

This is the VBA code that I am attempting to run. Would really appreciate it if anyone can help me here. Thank you!

Private Sub Form_BeforeUpdate(Cancel As Integer)
If BooReSequence = True Then
Exit Sub
End If
'When exit current tab with unsaved changes, pop up option for 'Discard' or 'Save'
Dim TLResponse As Integer

If Forms.frmFullCourseInfo.sbfrmTrainingElements.Form.Dirty Then
TLResponse = MsgBox("Do you want to save your changes?", vbYesNo, "Unsaved Changes")

  If TLResponse = vbYes Then
      DoCmd.Save
  Else
      Me.Undo
  End If

End If

End Sub

1

1 Answers

2
votes

The front end is an ACCDE file saved in a shared folder with the backend saved in a subfolder of that same folder (anyone with access to the front end has access to the back end). I am having users create a shortcut on their desktop to access the Front End. This allows me to make minor updates without requiring everyone to download the newest version.

That can also lead to precisely the kind of problems you describe. Everyone must have their own local copy of the front-end file.