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

Query can not recognize custom function

Status
Not open for further replies.

georgesOne

Technical User
Jul 2, 2004
176
JP
Hi everybody,

I am running a query which uses a custom function (coded in an ACCESS module). This works well in ACCESS, however, when run from EXCEL via DAO, the function is NOT recognized.
How to solve this?

Thanks for any advice, georges
 
Excel won't see Access user-defined functions. It may be possible to create your function in Excel VBA and use it.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Duane,

I believe I tried that some time ago and it did not work.
But I will try again.

Thanks & happy holidays, georges
 
This depends on how you want to use the function. We can't see your worksheet so it is a bit difficult to tell.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Duane,

I have the query coded in ACCESS (Name is e.g. Poly1) and the function the query uses is coded in ACCESS.
Excel calls the query with the query's name

Set dbs = bss_DataBase(iOpenMode)
Set rst = dbs.OpenRecordset("Poly")
With Sheets("PolyTrans")
.Range("T1") = rst.Fields(0).Name
.Range("T2").CopyFromRecordset rst
End With...........

Thanks, Georges
 
You can add a column to the right of your output that uses a custom function from Excel. It would be able to only reference values from the recordset.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top