Share via

Returning a null value

Anonymous
2015-09-04T07:45:12+00:00

Hi

I am trying to open one of the forms and report and keep getting a null value.  Actually I did use the desktop database template and created one.

The following is the vba code

Function FillMonths(fld As Control, id As Variant, iRow As Variant, iCol As Variant, code As Variant) As Variant

    Select Case code

        Case acLBInitialize

            FillMonths = True

        Case acLBOpen

            FillMonths = Timer

        Case acLBGetRowCount

            FillMonths = 12

        Case acLBGetColumnCount

            FillMonths = 2

        Case acLBGetColumnWidth

            If (iCol = 0) Then

                FillMonths = 0

            Else

                FillMonths = 2 * 1440

            End If

        Case acLBGetValue

            If (iCol = 0) Then

                FillMonths = iRow + 1

            Else

                FillMonths = MonthName(iRow + 1 Mod 12)

            End If

        Case acLBEnd

            FillMonths = True

    End Select

End Function

Function FillYears(fld As Control, id As Variant, iRow As Variant, iCol As Variant, code As Variant) As Variant

    Select Case code

        Case acLBInitialize

            TempVars!tmpSalesStartYear = Nz(TempVars!tmpSalesStartYear, Year(Date))

            TempVars!tmpSalesEndYear = Nz(TempVars!tmpSalesEndYear, Year(Date))

            FillYears = True

        Case acLBOpen

            FillYears = Timer

        Case acLBGetRowCount

            If (TempVars!tmpSalesEndYear >= TempVars!tmpSalesStartYear) Then

                FillYears = (TempVars!tmpSalesEndYear - TempVars!tmpSalesStartYear + 1)

            Else

                FillYears = 1

            End If

        Case acLBGetColumnCount

            FillYears = 1

        Case acLBGetColumnWidth

            FillYears = 1440

        Case acLBGetValue

            FillYears = TempVars!tmpSalesStartYear + iRow

        Case acLBEnd

            FillYears = True

    End Select

End Function

Function FillQuarters(fld As Control, id As Variant, iRow As Variant, iCol As Variant, code As Variant) As Variant

    Select Case code

        Case acLBInitialize

            FillQuarters = True

        Case acLBOpen

            FillQuarters = Timer

        Case acLBGetRowCount

            FillQuarters = 4

        Case acLBGetColumnCount

            FillQuarters = 2

        Case acLBGetColumnWidth

            If (iCol = 0) Then

                FillQuarters = 0

            Else

                FillQuarters = 1440

            End If

        Case acLBGetValue

            If (iCol = 0) Then

                FillQuarters = iRow + 1

            Else

                FillQuarters = iRow + 1

            End If

        Case acLBEnd

            FillQuarters = True

    End Select

End Function

Please help to resolve this.

Kind regards

VENU

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments