R
Roddy
Hi,
Can anyone provide information or links to data about the
first two arguments (fld and id) of the rowSourceType User-
Defined Function. The fld argument is always Null and never
refers to the list box being filled. Also the id argument
is always -1. Below is copy of my program and a copy of
the output. Thanks in advance.
Roddy
Option Compare Database
Option Explicit
'*****************************************
' ListBox Properties
' Name lbxTest
' Rowsource type lbxHandler
' Column Count 5
' Column Heads no
' Column Withs 0.4";0.4";0.6";0.8"
' Withs 4.1667"
'*****************************************
Private Function UdtHandler(fld As Control, id As Variant,
_
row As Variant, col As Variant, _
Code As Variant) As Variant
Static PrintHeader As Boolean
Dim varRetVal As Variant
varRetVal = -1
Select Case Code
Case 0
varRetVal = True
Case 1
varRetVal = Timer
Case 3
varRetVal = 1
Case 4
varRetVal = 5
Case 5
varRetVal = -1
Case 6
varRetVal = "R"
Case 7
varRetVal = -1
Case 8
Case 9
End Select
'Stop
On Error GoTo Err_Handler
Exit_Handler:
'Print values
If Not PrintHeader Then
Debug.Print "Code", " id", " row", " col", "
fld", "fld TypeName", "VarRetVal"
PrintHeader = True
End If
Debug.Print Code, id, row, col, fld, TypeName(fld),
varRetVal
UdtHandler = varRetVal
Exit Function
Err_Handler:
Debug.Print "** ERR ** "; Err.Number; ", in source ";
Err.Source; ", Desc= "; Err.Description
Resume Exit_Handler
End Function
Private Sub Form_Open(Cancel As Integer)
Debug.Print "** Form_Open Event **"
End Sub
Private Sub Form_Close()
Debug.Print "** Form_Close Event **"
End Sub
'***************************************** OUTPUT
*****************************************
'Code id row col
fld fld TypeName VarRetVal
' 0 -1 -1 -1
Null ListBox True
' 2 -1 -1 -1
Null ListBox -1
' 4 -1 -1 -1
Null ListBox 5
' 5 -1 -1 0
Null ListBox -1
' 5 -1 -1 1
Null ListBox -1
' 5 -1 -1 2
Null ListBox -1
' 5 -1 -1 3
Null ListBox -1
' 5 -1 -1 4
Null ListBox -1
' 5 -1 -1 0
Null ListBox -1
' 3 -1 -1 -1
Null ListBox 1
' 5 -1 -1 1
Null ListBox -1
' 5 -1 -1 2
Null ListBox -1
' 5 -1 -1 3
Null ListBox -1
' 6 -1 0 0
Null ListBox R
' 7 -1 -1 0
Null ListBox -1
' 6 -1 0 1
Null ListBox R
' 7 -1 -1 1
Null ListBox -1
' 6 -1 0 2
Null ListBox R
' 7 -1 -1 2
Null ListBox -1
' 6 -1 0 3
Null ListBox R
' 7 -1 -1 3
Null ListBox -1
' 6 -1 0 4
Null ListBox R
' 7 -1 -1 4
Null ListBox -1
'** Form_Open Event **
'** Form_Close Event **
' 8 -1 -1 -1
Null ListBox -1
' 9 -1 -1 -1
Null ListBox -1
Can anyone provide information or links to data about the
first two arguments (fld and id) of the rowSourceType User-
Defined Function. The fld argument is always Null and never
refers to the list box being filled. Also the id argument
is always -1. Below is copy of my program and a copy of
the output. Thanks in advance.
Roddy
Option Compare Database
Option Explicit
'*****************************************
' ListBox Properties
' Name lbxTest
' Rowsource type lbxHandler
' Column Count 5
' Column Heads no
' Column Withs 0.4";0.4";0.6";0.8"
' Withs 4.1667"
'*****************************************
Private Function UdtHandler(fld As Control, id As Variant,
_
row As Variant, col As Variant, _
Code As Variant) As Variant
Static PrintHeader As Boolean
Dim varRetVal As Variant
varRetVal = -1
Select Case Code
Case 0
varRetVal = True
Case 1
varRetVal = Timer
Case 3
varRetVal = 1
Case 4
varRetVal = 5
Case 5
varRetVal = -1
Case 6
varRetVal = "R"
Case 7
varRetVal = -1
Case 8
Case 9
End Select
'Stop
On Error GoTo Err_Handler
Exit_Handler:
'Print values
If Not PrintHeader Then
Debug.Print "Code", " id", " row", " col", "
fld", "fld TypeName", "VarRetVal"
PrintHeader = True
End If
Debug.Print Code, id, row, col, fld, TypeName(fld),
varRetVal
UdtHandler = varRetVal
Exit Function
Err_Handler:
Debug.Print "** ERR ** "; Err.Number; ", in source ";
Err.Source; ", Desc= "; Err.Description
Resume Exit_Handler
End Function
Private Sub Form_Open(Cancel As Integer)
Debug.Print "** Form_Open Event **"
End Sub
Private Sub Form_Close()
Debug.Print "** Form_Close Event **"
End Sub
'***************************************** OUTPUT
*****************************************
'Code id row col
fld fld TypeName VarRetVal
' 0 -1 -1 -1
Null ListBox True
' 2 -1 -1 -1
Null ListBox -1
' 4 -1 -1 -1
Null ListBox 5
' 5 -1 -1 0
Null ListBox -1
' 5 -1 -1 1
Null ListBox -1
' 5 -1 -1 2
Null ListBox -1
' 5 -1 -1 3
Null ListBox -1
' 5 -1 -1 4
Null ListBox -1
' 5 -1 -1 0
Null ListBox -1
' 3 -1 -1 -1
Null ListBox 1
' 5 -1 -1 1
Null ListBox -1
' 5 -1 -1 2
Null ListBox -1
' 5 -1 -1 3
Null ListBox -1
' 6 -1 0 0
Null ListBox R
' 7 -1 -1 0
Null ListBox -1
' 6 -1 0 1
Null ListBox R
' 7 -1 -1 1
Null ListBox -1
' 6 -1 0 2
Null ListBox R
' 7 -1 -1 2
Null ListBox -1
' 6 -1 0 3
Null ListBox R
' 7 -1 -1 3
Null ListBox -1
' 6 -1 0 4
Null ListBox R
' 7 -1 -1 4
Null ListBox -1
'** Form_Open Event **
'** Form_Close Event **
' 8 -1 -1 -1
Null ListBox -1
' 9 -1 -1 -1
Null ListBox -1