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!

Pass 2 values from a combo box

Status
Not open for further replies.

roystreet

Programmer
Oct 12, 2000
146
US
Hi - I have one combo box that shows values from 5 fields. 2 of which are important: POC name & Company name. I would like to populate 2 fields via that combo box...Is this possible? The main field needs to be POC name, but the 2nd field needs to be company name. Can I do this?

POC field is: "cboToFrom"
Company name field is: "cboCompanyName"

I've tried different methods, but I'm having a hard time going about this. The cboToFrom field pulls values from a contacts table showing their name, company name, address, etc. I want my users to be able to pick a poc name & it automatically place the company name in the cboCompanyName field, but I also want them to be able to manually change that field so it is also a drop down field.

Thanks,
~roystreet
 
Use the Column property of cboToFrom to set the value of cboCompanyName in the AfterUpdate event procedure of cboToFrom.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya roystreet . . .

Don't forget column index starts at zero!
Code:
[blue]   Me![[purple][B][I]TextboxName[/I][/B][/purple]] = Me!cboToFrom.Column([purple][b]?[/b][/purple])[/blue]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hey guys! - Thanks for the quick help. I placed the code in the after update - thanks PHV. I customized the code you gave me AceMan.

[thumbsup2]It worked great!! - Thank you so much

Have A Great Day,
~roystreet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top