Callback Function

  • Thread starter Thread starter George Pryhuber
  • Start date Start date
G

George Pryhuber

I created a from that I want to display all the databases
reports via a callback function.
I reviewed the procedure shown in the Solutions db but
need help with it.
Would you be able to correct the following code so it
would display the databases reports.

Function Reports_Fill(ctl As Control, lngID As Long,
lngRow As Long, lngCol As Long, intCode As Integer) As
Variant
Dim frm As Form_Reports

'Error if Form_Reports form isn't open.
Const conFormNotOpen = 2450

On Error GoTo Fill_Error

Select Case intCode
Case acLBInitialize 'Initialize the listbox.
Set colForm_Reports =
[Reports].ReturnCollection
lstForms_Fill = True

Case acLBOpen 'Open.
Reports_Fill = Timer

Case acLBGetRowCount 'Get the number of
rows.
Reports_Fill = colForm_Reports.Count

Case acLBGetColumnCount 'Get the number of
columns.
Reports_Fill = 1

Case acLBGetColumnWidth 'Get the column width.
Reports_Fill = -1 'Use the default width.

Case acLBGetValue 'Get the data.
Set frm = colForm_Reports(lngRow + 1)
Reports_Fill = [Reports]

End Select
Exit Function

Thank you,

George Pryhuber
 
The callback functions are message and slow.

This query works in all versions of Access:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32764) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY [Name];
 
Back
Top