If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Event Procedure with ACCDE
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 |
#2
|
|||
|
|||
Event Procedure with ACCDE
Has the folder in which the database is located been set as aTrusted
Location? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "HotRodSue" wrote in message ... 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 |
#3
|
|||
|
|||
Event Procedure with ACCDE
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? "Douglas J. Steele" wrote: Has the folder in which the database is located been set as aTrusted Location? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "HotRodSue" wrote in message ... 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 |
#4
|
|||
|
|||
Event Procedure with ACCDE
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. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "HotRodSue" wrote in message ... 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? "Douglas J. Steele" wrote: Has the folder in which the database is located been set as aTrusted Location? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "HotRodSue" wrote in message ... 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 |
#5
|
|||
|
|||
Event Procedure with ACCDE
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. "Douglas J. Steele" wrote: 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. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "HotRodSue" wrote in message ... 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? "Douglas J. Steele" wrote: Has the folder in which the database is located been set as aTrusted Location? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "HotRodSue" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|