Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    31

    Unanswered: Function works but results are displayed empty Version: 2003 (11.0)

    The function returns a value when debugged, but the query in which the function is called returns nothing in the field - what can be causing this issue -
    I am trying to convert field that may contain alpha + numeric characters or just numeric characters. I need to determine if a field starts with an Alpha character and if the length of the field is > 3.

    I have a field that could contain the following data possibilities:

    C1
    CH!
    A09
    A9
    12-01

    And it should display as follows
    12-01 = 01
    C1 = 01
    CH1 = 01
    A09 = 09
    A9 = 09

    what am I doing wrong?

    Function ConvertPropCh(nPropCh As String) 'As Variant
    Dim nPCH As String
    If Not IsNull(nPropCh) Then
    If Len(nPropCh) = 1 Then
    nPCH = 0 & "" & nPropCh
    ElseIf Len(nPropCh) > 1 And IsNumeric(nPropCh) Then
    nPCH = nPropCh
    ElseIf Len(nPropCh) > 2 And Not IsNumeric(nPropCh) Then
    nPCH = StrReverse(Format(Val(StrReverse(nPropCh)), "00"))
    End If
    End If
    nPropCh = nPCH
    Debug.Print nPropCh
    End Function


    --------------------
    Thanks,

    K

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The value returned when calling the function is the name of the function, so you want to set that to your value.
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •