Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 14th, 2003, 03:30 AM
Registered User
 
Join Date: Aug 2003
Location: Prague, , Czech Republic.
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
Reply With Quote
  #2 (permalink)  
Old August 18th, 2003, 09:29 AM
Authorized User
 
Join Date: Jun 2003
Location: Memphis, TN, USA.
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
Reply With Quote
  #3 (permalink)  
Old August 19th, 2003, 03:54 AM
Registered User
 
Join Date: Aug 2003
Location: Prague, , Czech Republic.
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
Reply With Quote
  #4 (permalink)  
Old August 19th, 2003, 07:02 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:58 PM.


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