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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How would i make information appear for a certain customer?

Status
Not open for further replies.

lynda1

Programmer
Mar 25, 2004
11
AU
I am currently building custom forms in Outlook 2003, and i am not familar with it's functions. What i want to do is:

(1)I have a combo box with company names
(2)Another combo box with contacts from different companies (3)Another combo box with different company lcoations!

Because there is so much data in each combo box, i need an example of visual basic code, that allows me to perform the following:

When a user selects a certain company from combo (1), i want that companies inforamtion to only appear in combo (2), & (3). I dont want to display the other contacts and locations.

How to i go about doing this Please Help!
Thank you
 
Hi is there a reason why no- one has responded to my email!

Have i not explained my problem well? Or is what i am asking to difficult to do?

Please let me know because i am really having difficulties!

Thank -you
 
Hi storyteller!

Thank you for the reply, however i am using Outlook 2003, and these templates are not supported with this version, it only outlook 97, & 98,!

I need some more help, i have visited these sites and they are unable to solve my problem!

Please suggest more solutions!

Thankyou
 
Hi, Thanks again for all the valuable resource, however i have already checked all of these sites, plus alot more that you haven't pointed me to, nothing seems to relate to my combo box. All code that i am seeing allows me to populate a combobox or list box, i have already populated it i just want an example of code that allows me to put in a case?
This is what i have come up with through research but it doesn't do anything when i run the form!

Private Sub cbocustomer_Change()

With Me
Select Case cbocustomer.ListIndex
Case 0: cbocustomer.ListFillRange = "=McDonalds"
Case 1: cborequest.ListFillRange = "=Sharon Smith"
Case 2: cborequest.ListFillRange = "=Paul Do"
Case 3: cborequest.ListFillRange = "=Cassey Brie"
Case 4: cbocustomer.ListFillRange = "=KFC"
Case 5: cborequest.ListFillRange = "=Kate New"
Case 6: cborequest.ListFillRange = "=Matthew Perry"
End Select
End With
End Sub
This formual gives me an error when I change List Fill, it tries to recognise the cbocustomer.

As formual is now nothing happens! Why and what do i do to make it work?
 
Hello lynda1,
From the research I have been doing it looks like you will have to have the values for the combo boxes reside in an Access table.
You can then use VBA code and SQL statements to populate the combo boxes based on the User's choices.
The book suggested at does give code examples on how to do this.

Good luck,
Michael

ps: In the near/immediate future I will be doing a project that will require me to do this. So, I'll try to remember to post my notes. ;-}
 
Hi Storyteller; thanks for all you help. I have however solved the problem with out have to use an access table. This is the code that solved my problem. (Those of you who are faced with a similar problem may wish to use this)

Sub cbocustomer_change()
Set thisPage = Item.GetInspector.ModifiedFormPages(1)
Set control = thisPage.Controls("cboCustomer")
if control.value = "McDonalds" then
set cborequest= thisPage.Controls("cborequest")
cborequest.PossibleValues = "Chris Smith;Paul Fish"
end if
if control.value = "West end" Then
set cborequest= thisPage.Controls("cborequest")
cborequest.PossibleValues = "John Paul"
end if
End Sub

Sub Item_CustomPropertyChange(ByVal Name)
' MsgBox ("CustomPropertyChange_" & Name)
if name = "customer" then
cbocustomer_change
end if
End Sub

After a week my problem has now been solved! Yeah!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top