COMBO BOXES (1 Viewer)

tracey75

Registered User.
Local time
Today, 15:31
Joined
Feb 18, 2000
Messages
50
I want to make a combo box,choose a name in that box, and have a different combo box that with link to one another. Example: 1st combo box will have a name JOHN I want the second combo box to automatically put his ext. in so I wont have to go and look up an ext. to a person every time I put a name in. It is very time consuming. I dont know VB so if there is a way to do it without that it would help. Any suggestions.
 

S

Registered User.
Local time
Today, 16:31
Joined
Feb 17, 2000
Messages
33
Yuo can try with a macro (after update event on combo1); the command yuo need is DLookup; so yuo can update the combo2 using combo1 as "criteria"

Good Luck
 

Travis

Registered User.
Local time
Today, 07:31
Joined
Dec 17, 1999
Messages
1,332
The best approach (in my humble opinion) is to add the Ext. as a column to the name Combo Box. You can make the Length 0 if you don't want to see it here.

Then on the AfterUpdate Event add this Code:

Private Sub Combo1_AfterUpdate()
Me.Combo2 = Me.Combo1.Column(1)
End Sub

DLookup is Ok but you can take a serious performance Hit. I prefer using Recordsets with Find. I understand that you don't use VBA much but I think learning this little bit might be helpful in your project.
 

tracey75

Registered User.
Local time
Today, 15:31
Joined
Feb 18, 2000
Messages
50
I dont want the NAME and EXT in the same combo box. So I would have to do it another way!
I dont know how to do macros I am as new to this than anyone here. If you can explain in great detail what to exactly do i would appreciate it
thanks


[This message has been edited by tracey75 (edited 02-23-2000).]
 

Data Slave

New member
Local time
Today, 15:31
Joined
Feb 22, 2000
Messages
9
tracey75 i figured it out! are you using the combo box wizard? if not, it's easier to use than trying to do everything yourself. if you don't have the wizard you should try installing the advanced wizards from your office 97/95 cd onto your pc. anyway, travis was right. if you go through the combo box wizard and put both of the columns in the combo box you can make the column width into zero by adjusting it to hide the column. then make a blank combo box with almost no properties (except where you want to store the data in a table - control source). in the AfterUpdate field go to the sql view. type in exactly what travis wrote but using the names of your combo boxes. example:
Private Sub ComboName_AfterUpdate()
Me.ComboExt = Me.ComboName.Column(1)
End Sub

This should work out for you. I've been working on this for months and I'm very excited to finally figure it out. Thank you so much.
Data Slave
 

tracey75

Registered User.
Local time
Today, 15:31
Joined
Feb 18, 2000
Messages
50
Well Data Slave,
I tried what you said and the combo box with the name/ext is ok but the one with just the ext doesnt work. I want it to them to link to each other. Could you email me a sample of your data dase that you worked on it would help sooooooo much. Thanks
 

tracey75

Registered User.
Local time
Today, 15:31
Joined
Feb 18, 2000
Messages
50
I FINALLY GOT IT THANK YOU SO MUCH FOR ALL OF YOUR HELP. I WAS ON THE RIGHT TRACK JUST MISSING ONE THING.

THANKS
 

Users who are viewing this thread

Top Bottom