Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Return Months instead of M (a2k (9.0.3821) SR-1 Jet 4.0)

    I have the following code in a report.

    strNumberOfIntervals returns the number of months or years
    strIntervalOfTime returns M or Y

    What can I wrap around DLookup("[strIntervalOfTime]", "[tbl_BP_FeeType]", "[lngFeeTypeID] = lngFeeTypeID") to return Months or Years instead of M or Y?

    Thanks, John

    Paragraph6 = _
    "Permission is herby granted to proceed with the work as set forth in the " & _
    "specifications, plans or statements now on file in the department. Any " & _
    "amendments made to the original plans and specifications must first be submitted " & _
    "for approval. This permit is in force for " & _
    DLookup("[strNumberOfIntervals]", "[tbl_BP_FeeType]", "[lngFeeTypeID] = lngFeeTypeID") & " " & _
    DLookup("[strIntervalOfTime]", "[tbl_BP_FeeType]", "[lngFeeTypeID] = lngFeeTypeID") & _
    "and then must be renewed. " & _
    "Failure to comply with all items of the " & _
    GetPref("Municipality Type") & " " & _
    "codified ordinances will result " & _
    "in stop work notice." _
    & vbCr + vbLf

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Return Months instead of M (a2k (9.0.3821) SR-1 Jet 4.0)

    The easiest way, of course, is to enter "Months" and "Years" instead of "M" and "Y" in the strIntervalOfTime field. Assuming that tbl_BP_FeeType is a lookup table, that doesn't involve a lot of overhead. If that isn't feasible, you could add a field strIntervalName, put "Months" and "Years" in it, and look up strIntervalName instead of strIntervalOfType.

    Otherwise, you could create the text in a Select Case statement:

    Dim strIntervalName As String
    Select Case DLookup("[strIntervalOfTime]", "[tbl_BP_FeeType]", "[lngFeeTypeID] = lngFeeTypeID")
    Case "D"
    strIntervalName = "Days"
    Case "W"
    strIntervalName = "Weeks"
    Case "M"
    strIntervalName = "Months"
    Case "Y"
    strIntervalName = "Years"
    Case Else
    strIntervalName = "?"
    End Select

Posting Permissions

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