Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toolbar controls VERY slow to build 1

Status
Not open for further replies.

joerobbins

Programmer
Jan 17, 2003
3
GB
Problem: Office widgets in VBA OK in Access97 but EXTREMELY slow in Access2000

The code below when run from function test() ON THE SAME MACHINE produces:

Using Acess97 (less than 1 second)
BOJ: 17/01/03 15:19:47 EOJ: 17/01/03 15:19:47

Using Access2000 (horrendous 20 seconds)
BOJ: 17/01/03 15:18:03 EOJ: 17/01/03 15:18:23

Both use Reference: Microsoft Office 9.0 Object Library
Access VBA code module fragment [this test simplifies actual application] :

Option Compare Database
Option Explicit
Public TestCommandBar As Office.commandBar
Private cboTest As Office.CommandBarComboBox

Public Function test()
Dim boj As Date, eoj As Date
Dim cbar As Office.commandBar
Set TestCommandBar = CommandBars.Add("BCStest", msoBarTop, , True)
Set cboTest = TestCommandBar.Controls.Add(msoControlDropdown)
With cboTest: .width = 150: .DropDownWidth = 200: .BeginGroup = True
.OnAction = "=pingCboTest()"
End With
boj = Now()
makeCboTest
TestCommandBar.Visible = True
eoj = Now()
Debug.Print "BOJ: " & boj & " EOJ: " & eoj
End Function


Public Function makeCboTest()
Dim ix As Integer
cboTest.Clear
For ix = 1 To 100
cboTest.AddItem "Entry" & ix ' THIS LINE TAKES ALL THE TIME
Next
cboTest.Enabled = True
End Function
Public Function pingCboTest()
Stop
End Function

 
Is your database on a server? If so, is that server running NT? If so, there is a known problem with making design changes (and that's effectively what you're doing to your toolbar) in Access 2000 which makes everything happen very slooooooooooowly - you can read more about it at
The same problem can also apply to Access 2002, apparently. [pc2]
 
Thanks for your message mp9.
After further testing on various systems/configurations, we've come to the conclusion that Access 2K just needs a lot more puff to do what Access 97 does!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top