Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing data via an external database query rtiguy Excel Discussion (Misc queries) 3 October 13th 08 08:02 PM
Tool bar: Data/Import external data/New database query Daniel Setting up and Configuration of Excel 3 February 28th 08 08:40 AM
Importing Data via Database Query Franklin Smith Excel Discussion (Misc queries) 0 October 17th 07 05:37 PM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
Database Query -- Data Type Mismatch StephenP Excel Discussion (Misc queries) 0 April 14th 05 07:05 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"