Event Procedure with ACCDE

H

HotRodSue

I created a new database, made a backup, then split the database. To protect
the front-end, I saved it as an ACCDE file. When I open the ACCDE file, and
open forms for data entry, the Event Procedures no longer work. How do I get
the Event Procedures working again?

The Event Procedures set up to do the following:
On Open: Go to New Record
After Update: Go to New Record
Before Update: Prompt User to Save

Below is the Event Code for one of my forms:
Option Compare Database

Private Sub Form_AfterUpdate()
DoCmd.GoToRecord , , acNewRec
End Sub

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
Dim iResponse As Integer

' Specify the message to display.
strMsg = "Do you wish to save the changes?" & Chr(10)
strMsg = strMsg & "Click Yes to Save or No to Discard changes."

' Display the message box.
iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")

' Check the user's response.
If iResponse = vbNo Then
' Undo the change.
DoCmd.RunCommand acCmdUndo

' Cancel the update.
Cancel = True
End If
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub
 
H

HotRodSue

Thanks for the quick response. Yes, I did make the location Trusted. This
is my first DB, and first DB Split. The backup accDB file is saved in a
backup folder I created. The split DB has both the accDE Front-end and the
accDB Back-end in their own folder. Any other ideas?
 
D

Douglas J. Steele

And both the front end and back end folders are Trusted?

Afraid that's the only idea I have at the moment. Hopefully someone else
will chime in with other ideas.
 
H

HotRodSue

Both front-end and back-end are in the same folder, and it is protected.

I did notice that after the split, the Event Procedure worked fine.

The problem came when I saved the front-end as an accDE file to protect it.

Again, many thanks for your help. Perhaps others may chime in too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top