• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Populate details based on combo box value: [VBA]

vijay.vizzu

Member
Dear All,


I have created a form, in that i put one combo box which will display the vendor names from a another workbook. I used sql statement to populate vendor names in that combo box, its working fine and showing vendor names, but i am in trouble to create a code that, whenever the user selected vendor name from that box, i wish to display the address of that selected vendor. I put a label below that combo box, to display the vendor address.


Can you please suggest me how to get this?
 
Vijay.vizzu


Can you post the code here so we can see what variables and data you have available


It will be something like

Code:
Userform1.Label1.caption = Something
 
Hi Vijay ,


If you are retrieving the address from the external workbook , then why can't you use SQL to retrieve the data ?


Use a SELECT FROM .... WHERE clause , using the appropriate syntax to specify the external workbook , worksheet and range names , and the criterion.


The selected vendor name is available , as has already been posted , as the Text property of the combo box.


You might find the following links helpful :


1. http://www.exceluser.com/explore/msquery1_1.htm


2. http://www.dicks-clicks.com/excel/ExternalData.htm


Narayan
 
Back
Top