Ok, Eupher really got me into the whole groupwise automation in access thing and now I can accomplish all kinds of things but I have no idea if there's a faster way. Here's some code I wrote to check our main address book for a matching email address to one provided by the user, and if found to populate various fields in my access form from the groupwise record for that email.
However, the main address book in groupWise has just over 10,000 entries and, by my vary unscientific testing procedure, I'm getting around 292 entries/minute searched via this procedure, which is just too slow. Any suggestions to speed it up via code improvement?
What I'm looking for is a way to skip down to a particular letter of the alphabet in the groupwise address book and begin my search there. the letter would be the first letter in the email address so it wouldn't require any additional work by the user.
Any ideas?
Here's the code that works, but is too slow:
Thanks in advance for any pointers!
T
However, the main address book in groupWise has just over 10,000 entries and, by my vary unscientific testing procedure, I'm getting around 292 entries/minute searched via this procedure, which is just too slow. Any suggestions to speed it up via code improvement?
What I'm looking for is a way to skip down to a particular letter of the alphabet in the groupwise address book and begin my search there. the letter would be the first letter in the email address so it wouldn't require any additional work by the user.
Any ideas?
Here's the code that works, but is too slow:
Code:
Private Sub cmdTest_Click()
Dim MyGWAuto As GroupwareTypeLibrary.Application2
Dim gwAccount As GroupwareTypeLibrary.Account2
Dim gwAddressBook As GroupwareTypeLibrary.AddressBook2
Dim gwAddress As GroupwareTypeLibrary.AddressBookEntries2
Dim i As Integer
Dim x As Integer
On Error GoTo cmdTest_Click_Error
Set MyGWAuto = New GroupwareTypeLibrary.Application2
Set gwAccount = MyGWAuto.Login()
Set gwAddressBook = MyGWAuto.Login.AddressBooks.Item("Novell GroupWise Address Book")
x = gwAddressBook.AddressBookEntries.Count
For i = 1 To x
If gwAddressBook.AddressBookEntries(i).EMailAddress = Me.txtEmailAddress Then
Me.txtBusinessPhone.SetFocus
Me.txtBusinessPhone.Text = gwAddressBook.AddressBookEntries(i).Fields(6)
Me.txtLastName.SetFocus
Me.txtLastName.Text = gwAddressBook.AddressBookEntries(i).Fields(7)
Me.txtFirstName.SetFocus
Me.txtFirstName.Text = gwAddressBook.AddressBookEntries(i).Fields(5)
Me.cmbFacility.SetFocus
Me.cmbFacility.Text = gwAddressBook.AddressBookEntries(i).Fields(8)
Exit Sub
Else
End If
Next i
Set MyGWAuto = Nothing
Set gwAccount = Nothing
Set gwAddressBook = Nothing
Exit_cmdTest_Click:
Exit Sub
cmdTest_Click_Error:
Call ErrorLog(Err.Description, Err.Number, Me.Name)
End Sub
Thanks in advance for any pointers!
T