Solved

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

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

706 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now