[AccessD] access.exe process not terminating

Hale, Jim Jim.Hale at FleetPride.com
Mon Sep 11 09:09:46 CDT 2006


Welcome to AccessD. In your function try setting each of your object
variables to nothing at the very end and see if this clears up the problem. 
ex 
set db=nothing 
set recLang=nothing
set FrmF=nothing 
set ctlc=nothing

HTH
Jim Hale

-----Original Message-----
From: Daniel Hurtubise [mailto:danielh at eti-canada.com]
Sent: Monday, May 01, 2006 3:03 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] access.exe process not terminating


Hello everyone:

This is my first post.  Sorry It might be a bit rough......

Objective:  To have a screen change it labels depending on language 
selected.

Situation:  Labels are all successfully changed and application works 
perfectly. HOWEVER:
                when leaving the application MSACCESS.EXE does not close 
out in
                the task manager.  This only happens if the translation 
module is called.

The code is inoffensive but I've been at it now for two days !!!!  The 
ghost being produced
leaves me believing that something is not closed properly. Any ideas?

Form A: Calls a function which sits within a  Module
' #########################################################
' Form Open Event
' #########################################################
Private Sub Form_Open(Cancel As Integer)
   '
   ' Set Language to current form
   '
   Call changeFormLanguage(glang, Me)
End Sub


Module Code:

' #########################################################
' This section will cycle every form for a language change
' #########################################################
Public Function changeFormLanguage(strLang As String, strFormName As Form)

    Dim db As Database
    Dim recLang As Recordset
    Dim objAo As AccessObject
    Dim objCP As Object
    Dim FrmF            As Form             ' current form
    Dim ctlc            As Control          ' current control
    Dim strControlName  As String           ' name of control
    Dim intControlType  As Integer          ' control type
    Dim strLangField    As String

    'open the database and language recordset
    Set db = CurrentDb()
    Set recLang = db.OpenRecordset(wcs_LANGUAGE_TABLE)
    recLang.Index = "PrimaryKey"

    Set FrmF = strFormName

    strLangField = IIf(strLang = "English", "Lbl_DescEn", "Lbl_DescFr")
    With recLang
       .Seek "=", strFormName, strFormName
      
       'add or update the form in the language table
       If .NoMatch Or IsNull(.Fields(strLangField)) Then
         FrmF.Caption = " "
       Else
         FrmF.Caption = .Fields(strLangField)
       End If
                
       'now loop through the controls
       For Each ctlc In FrmF.Controls
       'we are interested in the controls with captions
          intControlType = ctlc.ControlType
          If ControlHasCaption(intControlType) = True Then
          'find the control in the language table
             strControlName = ctlc.Name
             .Seek "=", strFormName.Name, strControlName
                         
             'add or update the control in the language table
             If .NoMatch Or IsNull(.Fields(strLangField)) Then
                ctlc.Caption = ""
             Else
                ctlc.Caption = .Fields(strLangField)
             End If
          End If
       Next
    End With

    'close up
    recLang.Close
    db.Close
End Function

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.


More information about the AccessD mailing list