Solved

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

Posted on 2015-02-09
2
215 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 500 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

820 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