ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data Validation from a database query ? (https://www.excelbanter.com/excel-programming/332709-data-validation-database-query.html)

sean2000

Data Validation from a database query ?
 

I have a function that returns a list of codes (comma seperated) from
database and i want to use that list as a data validation criteria.

Can anyone tell me the best way of doing it

--
sean200
-----------------------------------------------------------------------
sean2000's Profile: http://www.excelforum.com/member.php...fo&userid=2459
View this thread: http://www.excelforum.com/showthread.php?threadid=38184


keepITcool

Data Validation from a database query ?
 

First:
you need to create a database query via Data/Import
(this creates worksheet level name on the query sheet.)

If DV and QT are not on the same sheet:
create a Name for that range
(either at workbook level or in the worksheet
that holds the data validation)

Then:
assign the name as the source for the list in datavalidation.






--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


sean2000 wrote :


I have a function that returns a list of codes (comma seperated) from
a database and i want to use that list as a data validation criteria.

Can anyone tell me the best way of doing it?


DM Unseen

Data Validation from a database query ?
 
Not quite KIC, use as list formula:
=INDIRECT("MyQuerysheet!MyQueryName") should work, no need to add
another name.

DM Unseen


keepITcool

Data Validation from a database query ?
 
Thx!

good idea. never thought of that.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


DM Unseen wrote :

Not quite KIC, use as list formula:
=INDIRECT("MyQuerysheet!MyQueryName") should work, no need to add
another name.

DM Unseen


Tom Ogilvy

Data Validation from a database query ?
 
A function which returns a comma separated list would not work with indirect
or a defined name for the list option of Data Validation in my experience.



--
Regards,
Tom Ogilvy


"DM Unseen" wrote in message
oups.com...
Not quite KIC, use as list formula:
=INDIRECT("MyQuerysheet!MyQueryName") should work, no need to add
another name.

DM Unseen




sean2000[_2_]

Data Validation from a database query ?
 

Thanks for the replies

I wanted to avoid using the Data / Import way cause it seems like yo
need a dsn set up for that database and i've been using adodb to avoi
using a dsn.

Basically ive got a function called getPhases() which takes a projec
number from a cell and returns a list of phase codes depending on tha
project number

--
sean200
-----------------------------------------------------------------------
sean2000's Profile: http://www.excelforum.com/member.php...fo&userid=2459
View this thread: http://www.excelforum.com/showthread.php?threadid=38184


DM Unseen

Data Validation from a database query ?
 
Sean,

just a quick note on XL and dsn. It is true you use a DSN to create a
query, but after that the query will be independent from the DSN (this
depends on your XL version, the behavior has changed a little). Other
users don't need the DSN for your query to work.

DM Unseen



All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com