Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DAO 'Undefined Function' (2000/XP)

    Ok, this is possibly in the wrong section

    I have a db with a custom function (which concatenates fields and inserts a carriage return into the text string - it's an address).

    I'm using DAO in Excel to loop through some the recordsets from the db.

    When I try to open a query which uses myf unction I get the error 'Runtime error 3085 - Undefined function 'ExcelAddressFormat' in expression when I try to open the recordset

    Set rsOwners = db.OpenRecordset("qryXLS_02_Owners", , dbOpenForwardOnly)

    The function works fine in Access (as does the query)

    It is sitting in a code module and is defined as public.

    Public Function ExcelAddressFormat(Company As Variant, Addr1 As Variant, Addr2 As Variant, Addr3 As Variant, Addr4 As Variant, Addr5 As Variant, Addr6 As Variant, POSTCODE As Variant) As String

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DAO 'Undefined Function' (2000/XP)

    I'm afraid that DAO doesn't "know" about user-defined functions - it operates at a lower level than Access itself.

    One way to work around it is to run a make-table query in Access to store the results of the query in a table. You can then open a recordset on this table in Excel.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DAO 'Undefined Function' (2000/XP)

    That's disappointing but good to know.

    Thanks for the quick reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •