I have a small application that read provider numbers from
and excel worksheet but when a provider number intermix with alpha-numeric the recordset return Null and Don't know how to get around this. Any helps would be appreciated.
I've gotten around this problem by using the following function which I have placed in a module.
Public Function GetString(rVar_InData As Variant) As String
Dim lStr_WorkStr As String
If Not (IsNull(rVar_InData)) Then
lStr_WorkStr = Trim(CStr(rVar_InData))
Else
lStr_WorkStr =
End If
GetString = lStr_WorkString
End Function
---
Then change your assignment statements to the following
txtText.Text = GetString(rsRecSet("ColumnName")
Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
Cajun,
That's not what I want. The reason that record is null because the provider number contain Alpha-Numberic Value.
Not because that record does not exist.
What that code is doing is converting a null value in the recordset for a specific column into a valid nullstring. It has nothing to do with a record not found condition.
If Not (IsNull(rVar_InData)) Then
lStr_WorkStr = Trim(CStr(rVar_InData))
Else
lStr_WorkStr = vbNullString
End If
Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
Cajun,
I understand What it does, but that's not what I want.
when the recordset hits the providernumber that contains ALpha-numeric, It returns a value null even though that provider exist in the worksheet.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.