Andy Lacey
andy at minstersystems.co.uk
Mon May 1 15:29:21 CDT 2006
Daniel
As Doris says you need to set your objects to Nothing to resolve this, a
long outstanding Access "feature". It's probably recLang that's your
problem. Try:
recLang.Close: Set recLang=Nothing
db.Close: Set db = Nothing
And if you ever do anything with the other 2 objects set them to nothing
too.
-- Andy Lacey
http://www.minstersystems.co.uk
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> Daniel Hurtubise
> Sent: 01 May 2006 21:03
> 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
>