General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Passing a ADODB.Recordset Field to a function.
Is it possible to pass an ADODB.Recordset Field to a function?
Here is what I tried and I am getting a "Compile error: - ByRef argument type mismatch" error. I tried passing the "adoField" in by ref and get the same error.
Dim MyRS As New ADODB.Recordset
Set MyRS = New ADODB.Recordset
... processing logic to put values into the "PolicyNo" field along with others...
Set MyString = WF(MyRS("PolicyNo"))
Private Function WF(adoField As ADODB.Field, TotalWidth As Integer) As String
If adoField.Type = adNumeric Then
WF = PadNumeric(adoField, TotalWidth)
Else
WF = PadSpaces(adoField, TotalWidth)
End If
End Function
Thanking you in advance for your help.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only