[AccessD] access.exe process not terminating

Daniel Hurtubise danielh at eti-canada.com
Mon May 1 15:32:40 CDT 2006


Hello Doris:

Your right! However I took out the two Dim statements and I set
    Set ctlc = Nothing
    Set recLang = Nothing
    Set db = Nothing

and I still get the same error. Should I post a new thread with
those corrections so that everyone knows of the new code?

Regards
--
Daniel Hurtubise


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mike & Doris
Manning
Sent: May 1, 2006 4:22 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] access.exe process not terminating

You declare these two lines but don't do anything with them.

    Dim objAo As AccessObject
    Dim objCP As Object

You close your database and recordset connection but then you don't release
them by setting them to nothing.

Doris Manning
mikedorism at verizon.net

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Daniel Hurtubise
Sent: Monday, May 01, 2006 4: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


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





More information about the AccessD mailing list