If I stand correct, your function needs to be public in a module and you must create a query with your SELECT statement. Then, in VB, you SELECT the query.
>I have a simple SQL statement as:
> strSQL = "SELECT SSN, LName_only(Full_name) AS LNAME FROM EMPLOYEES" .
> oConn.Execute strSQL
>
>Using VB6, ADO, Access97 MDB data.
>
>Everything works fine, except my UDF LName_only() is UNDEFINED during runtime.
>I have tried putting the UDF EVERYWHERE I could think of.
>( The UDF merely grabs the first part of a name string up to the comma. )
>
>I must be missing something really basic. Any ideas ?
>
>Thanks much,
>Steve H
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com