G
Guest
Hello,
Hoping someone can help. I have imported a module from another database
which is executed from a query with the following sql statement:
SELECT TblComp.*
FROM TblComp
WHERE
(((IsSelectedVar("frmMultiselectListDemo","lboSpecificCompetency","SpecificCompetency"))=-1));
I think there might be something wrong with following code because I get an
error saying that it does not recrognise the form name. The problem in the
code I think is from the 15th line:
Function IsSelectedVar( _
strFormName As String, _
strListBoxName As String, _
varValue As Variant) _
As Boolean
'strFormName is the name of the form
'strListBoxName is the name of the listbox
'varValue is the field to check against the listbox
Dim lbo As ListBox
Dim item As Variant
If IsNumeric(varValue) Then
varValue = Trim(Str(varValue))
End If
Set lbo = Forms(strFormName)(strListBoxName)
For Each item In lbo.ItemsSelected
If lbo.ItemData(item) = varValue Then
IsSelectedVar = True
Exit Function
End If
Next
End Function
I'd really love some help understanding what the above code means from the
15th line onwards as that is what is highlighted in the error when you click
on the debug button. IN particular what does "lbo" mean exactly.
Thanks so much!
Angeline
Sydney
Hoping someone can help. I have imported a module from another database
which is executed from a query with the following sql statement:
SELECT TblComp.*
FROM TblComp
WHERE
(((IsSelectedVar("frmMultiselectListDemo","lboSpecificCompetency","SpecificCompetency"))=-1));
I think there might be something wrong with following code because I get an
error saying that it does not recrognise the form name. The problem in the
code I think is from the 15th line:
Function IsSelectedVar( _
strFormName As String, _
strListBoxName As String, _
varValue As Variant) _
As Boolean
'strFormName is the name of the form
'strListBoxName is the name of the listbox
'varValue is the field to check against the listbox
Dim lbo As ListBox
Dim item As Variant
If IsNumeric(varValue) Then
varValue = Trim(Str(varValue))
End If
Set lbo = Forms(strFormName)(strListBoxName)
For Each item In lbo.ItemsSelected
If lbo.ItemData(item) = varValue Then
IsSelectedVar = True
Exit Function
End If
Next
End Function
I'd really love some help understanding what the above code means from the
15th line onwards as that is what is highlighted in the error when you click
on the debug button. IN particular what does "lbo" mean exactly.
Thanks so much!
Angeline
Sydney