Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 14th, 2003, 03:30 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access stay in memory with .ColumnWidth property

Hi,
can anybody explain the fact, when I use .ColumnWidth and ColumnHidden property of controls in datasheet view, it cause Access stay in memory after I close my application? Than I have to kill "msaccess" process by hand. I use Access2000 + SP1 + SP2, Win98SE, Win2K. Thank's for your ideas.

Milan

Here is piece of code that I wrote:
(In this example are calls to functions for reading from XML file, but you can use normal values as you can.)

Public Function LoadFormCtrlSettings(frm As Form) As Boolean
Dim ctrl As Control
Dim result As Variant

  For Each ctrl In frm.Controls
   Set oXMLRecordNode = oXMLNode.selectSingleNode("prvek[@Name='" & ctrl.Name & "']")
   If Not oXMLRecordNode Is Nothing Then
    ctrl.Caption = oXMLRecordNode.getAttribute("Caption")
    ctrl.Hidden = oXMLRecordNode.getAttribute("Hidden")
    ctrl.ColumnOrder = oXMLRecordNode.getAttribute("ColumnOrder")
    If frm.CurrentView = 2 Then 'Datasheet View
     ctrl.ColumnWidth = CInt(oXMLRecordNode.getAttribute("ColumnWidth"))
     ctrl.ColumnHidden = CBool(oXMLRecordNode.getAttribute("ColumnHidden"))
     'result = oXMLRecordNode.getAttribute("ColumnHidden")
     'result = oXMLRecordNode.getAttribute("ColumnWidth")
    End If
    ctrl.ControlSource = oXMLRecordNode.getAttribute("ControlSource")
    ctrl.Left = oXMLRecordNode.getAttribute("Left")
    ctrl.Top = oXMLRecordNode.getAttribute("Top")
    ctrl.Width = oXMLRecordNode.getAttribute("Width")
    ctrl.Height = oXMLRecordNode.getAttribute("Height")

    'ctrl.left =
   End If
  Next ctrl

 LoadFormCtrlSettings=True
End Function
 
Old August 18th, 2003, 09:29 AM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having trouble with Access and Excel doing this, but it's not just with the ColumnWidth property, it's with several different things.

John
 
Old August 19th, 2003, 03:54 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You, but what do you mean? Which things doing this?
Well, is another way to set up columns in Access data grid? (Without memory leak)

Milan
 
Old August 19th, 2003, 07:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by xmasm1
 Thank You, but what do you mean? Which things doing this?
Well, is another way to set up columns in Access data grid? (Without memory leak)
Milan, what John is saying (and correct me if I'm wrong, John) is that it is probably not the column width settings that are specifically preventing your Access from closing.

Both John and I have experienced what you experience but I have never touched the column width settings. It often happens to me when I have a couple of forms open in design view, a table open in design view, and the VB editor open all at once and then I exit Access. Or sometimes it happens when I'm debugging and try to exit Access immediately after a debugging session.

In any case, I don't think you have a column width problem. I think you (and John and I) have Microsoft Access execution problems or Windows execution problems. I use Access XP on a Windows 2000 platform.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Load access 2003 database in memory Koeno Pro VB Databases 2 September 21st, 2008 12:27 PM
How to set ColumnWidth in DataGridView akumarp2p C# 2005 1 December 27th, 2006 02:32 AM
Memory access using vb.net Morrislgn VB.NET 2002/2003 Basics 0 February 6th, 2006 08:28 AM
Releasing Memory in Access Paulsh Access VBA 2 August 24th, 2005 07:32 AM
Invalid access to memory location sahih Beginning PHP 3 March 17th, 2004 09:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.