Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2015-02-09
2
Medium Priority
?
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

719 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