I recently migrated from programming in VBA behind Access to writing VB 6.0 Client Apps. While working on my current database project I came to a huge stumbling block. It seems VB6 doesn't recognize the function 'nz()'. This function checks to make sure what is supplied to it is not null, and if it is it sends back a zero-based string to replace it. I tried writing my own nz function but I get an invalid use of null error. Can anyone help?
Public Function nz(strValue As String, Optional strChar As String) As String
If Not IsNull(strValue) Then
nz = strValue
Else
nz = strChar
End If
End Function
----- Calling the function like this and get invalid
----- use of null error. 'rs' is my recordset in ADO.
txt1.Text = nz(rs("ECurrentPay"
)
Public Function nz(strValue As String, Optional strChar As String) As String
If Not IsNull(strValue) Then
nz = strValue
Else
nz = strChar
End If
End Function
----- Calling the function like this and get invalid
----- use of null error. 'rs' is my recordset in ADO.
txt1.Text = nz(rs("ECurrentPay"