A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Event Procedure with ACCDE



 
 
Thread Tools Display Modes
  #1  
Old January 15th, 2009, 07:54 PM posted to microsoft.public.access
HotRodSue
external usenet poster
 
Posts: 27
Default 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  
Old January 15th, 2009, 08:02 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default 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  
Old January 15th, 2009, 08:25 PM posted to microsoft.public.access
HotRodSue
external usenet poster
 
Posts: 27
Default 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  
Old January 15th, 2009, 08:43 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default 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  
Old January 15th, 2009, 09:15 PM posted to microsoft.public.access
HotRodSue
external usenet poster
 
Posts: 27
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.