ChloeRadshaw
06-02-2009, 05:07 AM
I always use Option Explicit and the compiler to check I am not doing anything stupid but I cannot understand why this is not flagged up as an incorrect type issue.
The function explcitily requests a fields datatype, whereas I am passing a recordset.
Why is this allowed?
Dim resultSet as ADODB.RecordSet
Call getDouble(resultSet, "SomeColumn")
Public Function getDouble(flds As fields, columnName As String) As Double
If (IsNull(flds.Item(columnName))) Then
getDouble = DEFAULT_DOUBLE
Else
getDouble = CDbl(flds.Item(columnName))
End If
End Function
The function explcitily requests a fields datatype, whereas I am passing a recordset.
Why is this allowed?
Dim resultSet as ADODB.RecordSet
Call getDouble(resultSet, "SomeColumn")
Public Function getDouble(flds As fields, columnName As String) As Double
If (IsNull(flds.Item(columnName))) Then
getDouble = DEFAULT_DOUBLE
Else
getDouble = CDbl(flds.Item(columnName))
End If
End Function