I have driffed a bit asp and found myself realy stuck in vba. First problem was I could run an sql query using the follwing lines:<BR><BR>Dim MyDb As Database<BR>Dim rst As Recordset<BR>Dim strName As String<BR><BR>Set MyDb = CurrentDb<BR>Set rst = MyDb.OpenRecordset("Select * from [table]")<BR><BR>Using this method gives an error 13 types do not match, I worked around this using DAO, it works fine but now I want to use my function in an query, that does not work because both the qyery and my function are trying to use DAO. Microsoft has an article about it, but no sollution ( http://support.microsoft.com/default.aspx?scid=kb;en-us;209864 )<BR><BR>What I&#039;m trying to accomplish is an colum in a table that is dynamicly calculated. So in short what I&#039;m looking for is a way to make this work or an other way to accomplish my goal.<BR><BR>Hope anyone can follow this and certainly hope someone can light some light on this mess ;)<BR><BR>Thanks for your time