Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

I am getting error 438 when displaying values from listbox to textbox

Posted on 2015-02-09
2
Medium Priority
?
238 Views
Last Modified: 2016-02-11
Private Sub txtListOfChoicesFull_Click()
 Dim strSelections As String
        Dim lngItem As Long
    strSelections = ""
   
      strSelections = ""
    Dim varItem As Variant
    For Each varItem In Me.List0.ItemsSelected
        If strSelections <> "" Then
            strSelections = strSelections & vbCrLf
        End If
        ' include data in first 2 columns
        strSelections = strSelections & Me.List0.Column(0, varItem) & _
                        " - " & Me.List0.Column(1, varItem)
    Next
   

   
    Me.txtListOfChoicesFull = strSelections
   
   
End Sub
0
Comment
Question by:Cali123
2 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 40599936
Other than having strSelections = "" twice and not using lngItem anywhere since you declared it, I don't see any problem.  I tried it in a form and it works fine.  What line does it error on?

Ron
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 40599991
What version of the MS Access Library do you have loaded in your VBA references?
 (In the VBA editor, click: Tools-->References)
For Office 2010, I think you need the 14.0 Library
For Office 2013 in might be the 15.0 Library
...

Also, does the code compile?
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question