function to call an ODBC query...
yes
public function myLookup( clause as string ) as variant
dim sqlString as string
sqlString = "SELECT * FROM myTable " + clause ' IE Where Customer='Londis'
'....... Your code for accessing the server
myLookup = myResult
end function
"N Ramsay" wrote in message
ps.com...
Hi,
I have an Import Data query set up (ODBC connection saved as a.dqy
file) which returns two columns from a SQL d/b.
What I normally do is run this and then use the results (big 2-column
list) as the basis of a vlookup table.
What I would prefer to do is create a custom function which calls the
ODBC connection.
The function would pass in one parameter and return the result of a
vlookup done on the big list generated by the ODBC query.
Is it possible to code this in VBA?
Thanks in advance.
Neil.
|