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
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