Solved

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

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make a Cell act like a Date 7 39
IIF help, YN field 7 22
Filter a form 8 15
Access Importing Table Query With Specific Timestamp Daily 2 16
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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