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

Get data from database

Status
Not open for further replies.

intose

IS-IT--Management
Mar 9, 2011
3
SE
Hi

Not shure if this question is a VBA specific, it could mayby be done in Excel it self?!

I'll try to explain and mayby someone can point me in any direction.

I have a form in Excel and want user to type productid in a cell and i will by VBA or any other mehood get productdescription, price and more from a database that can be accessed via ODBC.

Anybody got some suggestion?

Thanx
Torfi
 
Hi,

MW Query via Data>Get external data>From other sources>From Microsoft Query...

You must have an appropriate ODBC driver configured for your database.

You can query it in a similar way that you would in Access.
 
To make your query dynamic use parameter(s) in the ms query data builder (add =[SelectProductID] in criteria, assuming that it is not existing field name in selected tables). Link the parameter(s) to cell(s) and set updating dataset when the cell changes. As a result the user will input ProductID in the cell and will get the answer updated automatically.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top