Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

VBA Code in an After Update Event Exiting Access - BCP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BCP - 06 Jan 2005 13:34 GMT
I have an After Update event that dumps the user completely out of Access.  
The best part is it only happenes intermittently and for some users more than
others.  Also if I break the code and step through it it works fine.
Nick Coe \(UK\) - 06 Jan 2005 13:40 GMT
> I have an After Update event that dumps the user
> completely out of
[quoted text clipped - 3 lines]
> through it
> it works fine.

Need a bit more context info than that.

Signature

Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Copy
----

BCP - 10 Jan 2005 19:07 GMT
When the On Click event is executed from the form MS Access shuts down.  If a
break point is put into the code and the code is steped through it executes
fine.

OS: Win2K for NT
Access Version: Access 97
Ram: 128 Mb
The following code is executed on the On Click event ona form.
Private Sub SignSel1_Click()
   If Me![SignSel1] = "Cancel" Then
       Me![Action] = Null
       Me![SignSrc1] = ""
       Me![SignDt1] = Null
       Me![ActCompDt1] = Null
       MsgBox "Cancelling does not reset the Project Status - please ensure
status is reset in Project Master to original value."
       If (Forms![Active Release Log Update]![StatCd1] = "Prod") And
(Forms![Active Release Log Update]![Status] = "Prod") Then
           Forms![Active Release Log Update]![Status Date] = Date
           Forms![Active Release Log Update]![Status] = "QA"
           DoCmd.OpenForm ("Audit Table"), acNormal, , , acFormAdd, acHidden
           Forms![Audit Table]![Audit Source] = [CurrentUser]
           Forms![Audit Table]![Audit Field] = "Status Reset"
           Forms![Audit Table]![Audit New Value] = Forms![Active Release
Log Update]![Status]
           Forms![Audit Table]![Audit Project Number] = Me![Project Number]
           DoCmd.Close acForm, "Audit Table", acSaveNo
           GoTo BypassSO:
       Else
           GoTo BypassSO:
       End If
   End If
     
   If (Forms![Active Release Log Update]![Status] = "QDen") Or
(Forms![Active Release Log Update]![Status] = "TDen") Then
       MsgBox "You may not approve a project in denied status, please reset
the Denial button and then retry"
       GoTo BypassSO:
   End If
   If (Forms![Active Release Log]![DepNotOK] = "NO") And (Forms![Active
Release Log Update]![Status] = "TOG") Then
       MsgBox "You may not approve a project when it contains subordinate
projects that have not been approved"
       GoTo BypassSO:
   End If
     
   If (Forms![Active Release Log]![OpenTkt] > "") Then
       DoCmd.OpenForm "Active Release Log OpenTkt Popup", acNormal
       GoTo BypassSO:
   End If
   
   If Me![SignSrc1] > "" Then
       Me![SignSrc1] = Me![SignSrc1] & ", " & Me![Resource1] & "(" & Date &
"/" & [CurrentUser] & ")"
   Else
       Me![SignSrc1] = Me![Resource1] & "(" & Date & "/" & [CurrentUser] &
")"
   End If
   Me![SignDt1] = Date
   DoCmd.OpenForm ("Audit Table"), acNormal, , , acFormAdd, acHidden
   Forms![Audit Table]![Audit Source] = [CurrentUser]
   Forms![Audit Table]![Audit Field] = "SignoffSel"
   Forms![Audit Table]![Audit New Value] = Me![SignSrc1] & " for " &
Me![StatCd1]
   Forms![Audit Table]![Audit Project Number] = Me![Project Number]
   DoCmd.Close acForm, "Audit Table", acSaveNo
   
   If Me![ActCompDt1] > "" Then
       GoTo BypassSO:
   End If
   If (Forms![Active Release Log Update]![StatCd1] = "Prod") And
(Forms![Active Release Log Update]![OKtoProd] <> "Yes") Then
       If Me![Release Key] Like "*-n*" Then
           GoTo BypassSO:
       Else
           Me![Action] = "SATApp"
           GoTo BypassSO:
       End If
   Else
       Me![ActCompDt1] = Me![SignDt1]
   End If
   DoCmd.OpenForm ("Audit Table"), acNormal, , , acFormAdd, acHidden
   Forms![Audit Table]![Audit Source] = [CurrentUser]
   Forms![Audit Table]![Audit Field] = "Act Comp Dt"
   Forms![Audit Table]![Audit New Value] = Me![ActCompDt1] & " for " &
Me![StatCd1]
   Forms![Audit Table]![Audit Project Number] = Me![Project Number]
   DoCmd.Close acForm, "Audit Table", acSaveYes
   If (Forms![Active Release Log Update]![Status] = "TOG") And
(Forms![Active Release Log Update]![StatCd1] = "TOG") Then
       Forms![Active Release Log Update]![Status Date] = Me![ActCompDt1]
       Forms![Active Release Log Update]![Status] = "QA"
       DoCmd.Save
       If (Me![Release Key] Like "*-Q*") Then
           Me![Action] = "ToQA"
       End If
   ElseIf (Forms![Active Release Log Update]![Status] = "QA") And
(Forms![Active Release Log Update]![StatCd1] = "Prod") Then
       Forms![Active Release Log Update]![Status Date] = Me![ActCompDt1]
       Forms![Active Release Log Update]![Status] = "Prod"
       DoCmd.Save
       If (Me![Release Key] Like "#.#*") Then
       Else
           Me![Action] = "ToProd"
       End If
   End If
BypassSO:
End Sub
"Nick Coe (UK)" wrote:

> > I have an After Update event that dumps the user
> > completely out of
[quoted text clipped - 5 lines]
>
> Need a bit more context info than that.
Nick Coe \(UK\) - 11 Jan 2005 07:02 GMT
> When the On Click event is executed from the form MS
> Access shuts
[quoted text clipped - 8 lines]
> form.
> Private Sub SignSel1_Click()

SNIPPED

Do you get anything if you put error trapping in?

> Private Sub SignSel1_Click()
'Add second line;
On Error GoTo HandleErr

then in the penultimate line of your code;

ExitHere:
 Exit Sub

HandleErr:
  MsgBox "Error " & Err.Number & ": " & Err.Description,
vbCritical
  Resume ExitHere

End Sub

Signature

Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Copy
----

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.