Re: Help me Crack the Code

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm not sure what you mean by "a static table".

--
Duane Hookom
MS Access MVP
--

"Angeline" <Angeline@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:82D561CD-B49F-437C-A1D4-4C2ECB628826@xxxxxxxxxxxxxxxx

Duane,
I wander if you could help me progress with this. Now that I have the
multi-select list box working (thank you) how can I get the results of the
query into a static table. The goal is for the user to be able to see
their
results in a report which they can print off. Is this prossible?

Thanks again for your help!
Angeline

"Duane Hookom" wrote:

The code looks familiar.

The third argument in the function must be a field name from tblComp. You
are sending in a text value. It may be that you only need to change the
"SpecificCompetency" to [SpecificCompetency].

Do you have a form open named "frmMultiselectListDemo" and does this form
have a multi-select list box named "lboSpecificCompetency"?

--
Duane Hookom
MS Access MVP
--

"Angeline" <Angeline@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B76649CD-3DE1-43F4-8009-E0137EC2EC69@xxxxxxxxxxxxxxxx
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





.


Quantcast