Populating Cells in excel using a combo box in excel from an access table or query.

What I'm trying to accomplish is getting data from a table in Access to Excel only populating certain cells within an Excel Sheet by selecting the Supplier Name from a drop down box that user selects.  The Combo Box selection is in the Excel file.

 I have a database called Supplier

 For example: Table Called Supplier.  When the user selects a Supplier name it populates the following:

 Supplier_Name to cell B3
 Supplier_Address to cell B4
 Supplier_City to cell B5
 Supplier_ST to cell C5
 Supplier_Zip to cell B6
 Supplier_POC to cell B9
 Supplier_Phone to cell B12
 Supplier_Fax to cell B15

 The Excel file is called RFQ:  

 See attached files

C--Users-Luis.Freund.EXT-Desktop-E.accdb
C--Users-Luis.Freund.EXT-Desktop-Ex.xlsx
LUIS FREUNDAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PatHartmanCommented:
Since the sheet you want to populate is not a "table", then you have to use OLE automation.  That means you need to write VBA code to open Excel and update each cell one at a time.  You can't use TransferSpreadsheet.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please find the attached with a drop down in cell B3 on Sheet1.
The code assumes that the database C--Users-Luis.Freund.EXT-Desktop-E.accdb is saved at your desktop.
So once you select a name from the drop down in B3, the code will retrieve the relevant data on the AccessData sheet and the formulas on Sheet1 will return all the data from AccessData sheet.
The third sheet is called List contains a list of suppliers which is used as a source for validation list in B3 on Sheet1.

See if this is what you were trying to achieve.

Note: This is a macro-enabled workbook so you will need to enable the macros while prompted.
C--Users-Luis.Freund.EXT-Desktop-Ex.xlsm
0
LUIS FREUNDAuthor Commented:
AWESOME.......

I added more records to the DB and added the supplier name to sheet3 but on the dropdown box I'm not seeing the new suppliers I added.

any ideas?
0
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Okay. Please find the attached and just add suppliers names on List sheet starting from A2 and all the names would be visible in the drop down list in B3 on Sheet1.
C--Users-Luis.Freund.EXT-Desktop-Ex.xlsm
0
LUIS FREUNDAuthor Commented:
THIS IS GREAT!   Another quick question....how did you create the combo box and link it to the list?
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
I created a dynamic named range called "Suppliers" on List Sheet and then used this list as a source for data validation list in B3.
To view the named range, go to Formulas Tab, under Defined Names Group, click on Name Manager and there you will find the named range.
To view the source for the drop down list in B3, select the cell B3 and then go to Data Tab, click on Data Validation and you will find the details for drop down in there.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.