Code:
Function fncGetReports(Ctrl As Control, varID As Variant, _
varRow As Variant, varCol As Variant, varCode As Variant) _
As Variant
'Assign all report names to the combo box.
Dim obj As AccessObject
Dim proj As CurrentProject
Set proj = Application.CurrentProject
Select Case varCode
Case acLBInitialize
fncGetReports = True
Case acLBOpen
fncGetReports = Timer
Case acLBGetRowCount
fncGetReports = proj.AllReports.Count
Case acLBGetColumnCount
fncGetReports = 1
Case acLBGetColumnWidth
fncGetReports = -1
Case acLBGetValue
Set obj = proj.AllReports(varRow)
fncGetReports = obj.Name
End Select
End Function
Bookmarks