Unanswered: Grrr, function not returning a value to cell
I have the below function added to "this workbook" in order to fetch a number from a local SQL-Server database based on a value (typicaly from another cell).
Well, if I call the function in a form button, I get a return value, which is correct.
But, if I use the function in a cell, nothing happens...
Am I missing something obvious? I must admit I've never made use of functions this way, always through forms etc. so quite possible I'm missing something :-)
Function FindGID(IPD As Variant)
Dim GIDdns As New ADODB.Connection
Dim ipdnParam As New ADODB.Parameter
Dim GIDrs As ADODB.Recordset
Dim kommando As New ADODB.Command
GIDdns =my dns info
ipdnParam.Type = adInteger
ipdnParam = IPD
kommando.ActiveConnection = GIDdns
kommando.CommandText = "ket.EXCEL_IPDfind"
kommando.CommandType = adCmdStoredProc
Set GIDrs = kommando.Execute
FindGID = GIDrs!medlemsnummer
IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....