A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

use listbox to look up outlook contat



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 14th 11, 06:31 PM
FunnyJuggler FunnyJuggler is offline
Junior Member
 
First recorded activity at Outlookbanter: Dec 2011
Posts: 1
Question use listbox to look up outlook contat

I'm wanting to have a phone # field on a user form, which users type in a contacts phone #. Next to it would be a listbox, that would display contacts whose phone # matches the phone number (or partial Phone #) that has been entered.

my contacts file contains around 3000 entries, and my first attempt to do this which cycled through each contact, took over a minute to run, which made the form useless.

Basically the LookUpClientPhone field's onchange action triggered the re population of the listbox, by checking each contact in the contacts folder.




Me.Listbox_Clients.Clear ' clear old values from list box

If Len(LookUpClientPhone.Value) 4 Then 're populate if user has typed at least 5 digits of a phone number

Debug.Print "updating lookup list"
For X = 1 To ContactCount
comparePhone = iCloudContacts.Items.Item(X).BusinessTelephoneNumb er
comparePhone = Replace(comparePhone, "(", "")
comparePhone = Replace(comparePhone, ")", "")
comparePhone = Replace(comparePhone, "-", "")
comparePhone = Replace(comparePhone, "", "")

If InStr(comparePhone, LookUpClientPhone) 0 Then
' add this client to the list
' Debug.Print "Client " & iCloudContacts.Items.Item(X).FullName & " will be added to the list"


' End If
' Next X



Paul
Ads
 




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Colors in Listbox Guille Outlook and VBA 2 July 1st 09 05:51 AM
Listbox bound Mike O[_2_] Outlook - Using Forms 6 June 3rd 09 07:39 AM
Outlook Script: How to separate datas in a listbox bbnimda Outlook - Using Forms 1 January 14th 08 05:39 PM
listbox w/ multiselect (outlook forms) David Chang Outlook and VBA 1 January 8th 07 07:25 PM
How Do I automate contat name on calendar NewsSearch Outlook - Calandaring 3 April 20th 06 12:41 PM


All times are GMT +1. The time now is 05:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.