+ Reply to Thread
Results 1 to 19 of 19

User Form ListBox - Find Records (ListBox Populating Issue)

Hybrid View

  1. #1
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    User Form ListBox - Find Records (ListBox Populating Issue)

    Hello:

    I'm trying to troubleshoot my code that finds all records that matches data entered into Member# (textbox), and populates a ListBox if more than 1 record is found. Everything works perfectly, the only thing I can't figure out is why, when multiple records are found, the ListBox is not being populated on the correct lines. I've set the properties on the ListBox to indicate column Headers. However, when the data is pasted into the ListBox, it is being pasted onto the 2nd line (after the header) - so it looks something like this:

    Header line (nothing is populated)
    line 1 - nothing is populated
    line 2 - displays header from the datatab
    line 3 - displays the first instance of the record found
    line 4 - displays the second instance of the record found

    I've been racking my brain for days....I'm hoping someone will be able to help me resolve this. THANK YOU IN ADVANCE FOR YOUR ASSISTANCE!


    Here is my code:

    Private Sub cmdFind_Click()
        'Set Variables
        Dim strFind As String    'what to find
        Dim FirstAddress As String
        Dim rSearch As Range  'range to search
        Set rSearch = Sheets("FraudTracker").Range("a2", Range("a65536").End(xlUp))     'Search from the last row up till cell A2 is reached
        Dim f As Integer            'Number or records returned in search
    
    
        imgFolder = ThisWorkbook.Path & Application.PathSeparator & "images" & Application.PathSeparator
        
        'Search for the data in the MemberNumber Text Box
        strFind = Me.tbMemNum.Value
    
        With rSearch
            'Search all rows for strFind
            Set c = .Find(strFind, LookIn:=xlValues)
            
            'If data is found load the rest of that row into the form
            If Not c Is Nothing Then
                c.Select
                
                'Loads Form
                'TextBox.Value is the Text Box to be populated
                'c.Offset(0, X).Value means from column A, offset X number if cells
                'Column A is (0, 0).  Column B is (0, 1).  Column F is (0, 5).  Etc.
                With Me
                    .tbMemNum.Value = c.Value
                        .tbDate1.Value = c.Offset(0, 1).Value
                        .cboIssueType.Value = c.Offset(0, 2).Value
                        .cboIssueReportedBy.Value = c.Offset(0, 3).Value
                        .tbDateIssue.Value = c.Offset(0, 4).Value
                        .cboIssueStatus.Value = c.Offset(0, 5).Value
                        .tbSource.Value = c.Offset(0, 6).Value
                        .tbOpenDate.Value = c.Offset(0, 7).Value
                        .tbEnrollMeth.Value = c.Offset(0, 8).Value
                        .cboUI.Value = c.Offset(0, 9).Value
                        .FName.Caption = c.Offset(0, 10).Value
                        .LName.Caption = c.Offset(0, 11).Value
                        .Address.Caption = c.Offset(0, 12).Value
                        .City.Caption = c.Offset(0, 13).Value
                        .State.Caption = c.Offset(0, 14).Value
                        .Zip.Caption = c.Offset(0, 15).Value
                        .tbFraud.Value = c.Offset(0, 16).Value
                        .tbBonusPt.Value = c.Offset(0, 17).Value
                        .tbGoldPt.Value = c.Offset(0, 18).Value
                        .tbOtherPt.Value = c.Offset(0, 19).Value
                        .tbPtsRedeemed.Value = c.Offset(0, 20).Value
                        .tbPoint.Value = c.Offset(0, 21).Value
                        .tbDollar.Value = c.Offset(0, 22).Value
                        .cboSiteID.Value = c.Offset(0, 23).Value
                        .tbSummary.Value = c.Offset(0, 28).Value
                        .cboCredit.Value = c.Offset(0, 29).Value
                        .tbCrAmt.Value = c.Offset(0, 30).Value
                        .tbCrDate.Value = c.Offset(0, 31).Value
                    .cmdEdit.Enabled = True        'allow for record to be amended
                    .cmdClose.Enabled = True           'allow record deletion
                    .cmdAdd.Enabled = True              'allow for new record to be created
    
                    f = 0
                End With
            
                FirstAddress = c.Address
                Do
                    f = f + 1    'count number of matching records
                    Set c = .FindNext(c)
                Loop While Not c Is Nothing And c.Address <> FirstAddress
                
                'If multiple entries are found, return a message box to aleart the user
                If f > 1 Then
                    Select Case MsgBox("There are " & f & " instances of " & strFind, vbOKCancel Or vbExclamation Or vbDefaultButton1, "Multiple entries")
                        
                        'If user clicks OK, exceute the FindAll function
                        Case vbOK
                            FindAll
                        'If user clicks Cancel, exit out of this funciton
                        Case vbCancel
             
                    End Select
                    Me.Height = 750
    
                End If
                
            'If no matching data is found, pop up a message box to inform the user
            Else: MsgBox strFind & " not listed"    'search failed
            End If
        End With
        If Sheets("FraudTracker").AutoFilterMode Then Sheets("FraudTracker").Range("A2").AutoFilter
    
    End Sub
    
    '**************************************************************************************
    'FindAll Function
    'Finds all records matching the search from Search by Name and returns them to a List Box
    '**************************************************************************************
        
    Sub FindAll()
    
    
    'Set Variables
    Dim strFind As String 'what to find
    Dim rFilter As Range 'range to search
    Dim c As Range, a() As String, n As Long, I As Long
    Set rFilter = Sheets("FraudTracker").Range("A2", Range("a65536").End(xlUp))
    Set rng = Sheets("FraudTracker").Range("A2", Range("a65536").End(xlUp))
    
    strFind = Me.tbMemNum.Value     'Search value is MemberNumber
    
    With Sheet1
        If Not .AutoFilterMode Then .Range("A2").AutoFilter
        rFilter.AutoFilter Field:=1, Criteria1:="*" & strFind & "*"
        Set rng = rng.Cells.SpecialCells(xlCellTypeVisible)
        
        'Clear any data currently in the List Box
        Me.ListBox1.Clear
        
        'For each found entry return columns 0 to 32
        For Each c In rng
            n = n + 1: ReDim Preserve a(0 To 32, 0 To n)
            For I = 0 To 32
                a(I, n) = c.Offset(, I).Value
            Next
        Next
    End With
    
    'For each record found, enter it into the List Box
    If n > 0 Then Me.ListBox1.Column = a
    
    End Sub
    
    'ListBox Function
    'Takes the data found between the search function and the FindAll function and inserts
    'the basic data into a List Box where a user can then select the proper record to edit or delete
     
    Private Sub ListBox1_Click()
    
        'Checks that there is data to be entered into the listbox.
        'If there isn't it pops up a message box
        If Me.ListBox1.ListIndex = -1 Then    'not selected
            MsgBox " No selection made"
            
        'If data is found, the populate the List Box
        ElseIf Me.ListBox1.ListIndex >= 1 Then    'User has selected
            r = Me.ListBox1.ListIndex
    
            'TextBox.Value is the Text Box where the data is coming from
            'ListBox1.List(r, X) is the cell in the List Box data is entered into
            'Column A is (r, 0).  Column B is (r, 1).  Column F is (r, 5).  Etc.
            'r equals the row of the List Box data is being entered into.
            With Me
    .tbDate1.Value = ListBox1.List(r, 1)
    .cboIssueType.Value = ListBox1.List(r, 2)
    .cboIssueReportedBy.Value = ListBox1.List(r, 3)
    .tbDateIssue.Value = ListBox1.List(r, 4)
    .cboIssueStatus.Value = ListBox1.List(r, 5)
    .tbSource.Value = ListBox1.List(r, 6)
    .tbMemNum.Value = ListBox1.List(r, 0)
    .tbOpenDate.Value = ListBox1.List(r, 7)
    .tbEnrollMeth.Value = ListBox1.List(r, 8)
    .cboUI.Value = ListBox1.List(r, 9)
    .FName.Caption = ListBox1.List(r, 10)
    .LName.Caption = ListBox1.List(r, 11)
    .Address.Caption = ListBox1.List(r, 12)
    .City.Caption = ListBox1.List(r, 13)
    .State.Caption = ListBox1.List(r, 14)
    .Zip.Caption = ListBox1.List(r, 15)
    .tbFraud.Value = ListBox1.List(r, 16)
    .tbBonusPt.Value = ListBox1.List(r, 17)
    .tbGoldPt.Value = ListBox1.List(r, 18)
    .tbOtherPt.Value = ListBox1.List(r, 19)
    .tbPtsRedeemed.Value = ListBox1.List(r, 20)
    .tbPoint.Value = ListBox1.List(r, 21)
    .tbDollar.Value = ListBox1.List(r, 22)
    .cboSiteID.Value = ListBox1.List(r, 23)
    .tbSummary.Value = ListBox1.List(r, 28)
    .cboCredit.Value = ListBox1.List(r, 29)
    .tbCrAmt.Value = ListBox1.List(r, 30)
    .tbCrDate.Value = ListBox1.List(r, 31)
                .cmdEdit.Enabled = True        'Allow for Amendment by Name
                .cmdClose.Enabled = True           'Allow for record Deletion
                .cmdAdd.Enabled = True              'Allow to add a new record
    
            End With
            
            'move to the next row of the List Box
            r = r - 1
        End If
    End Sub

  2. #2
    Registered User
    Join Date
    06-12-2015
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    83

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    If i understand your problem correctly you need to initiate the n variable at -1, not at zero.

    When you have multiple records, you a matrix is empty on position (I,0)

    try this:


    With Sheet1
        If Not .AutoFilterMode Then .Range("A2").AutoFilter
        rFilter.AutoFilter Field:=1, Criteria1:="*" & strFind & "*"
        Set rng = rng.Cells.SpecialCells(xlCellTypeVisible)
        
        'Clear any data currently in the List Box
        Me.ListBox1.Clear
        
        n=-1
    
        'For each found entry return columns 0 to 32
        For Each c In rng
            n = n + 1: ReDim Preserve a(0 To 32, 0 To n)
            For I = 0 To 32
                a(I, n) = c.Offset(, I).Value
            Next
        Next
    End With
    
    'For each record found, enter it into the List Box
    If n >= 0 Then Me.ListBox1.Column = a
    or i might be misunderstanding your problem.
    Got help? Pls give rep.
    If you do R&D learn VBA

  3. #3
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Thank You, JoeFoot! You definitely understood my issue. I made the change to set n = -1, but it looks the data is still off one row. I would expect the header to be in the defined header row (set properties on ListBox to indicate Headers). Below is what the data now looks like:

    Header Row (nothing is populated)
    line 1 - displays header from the datatab
    line 2 - displays the first instance of the record found
    line 3 - displays the second instance of the record found

    I tried to change n=-1 to n=-2, but I get a "Run-time error '9" Subscript out of range"

    I do appreciate your time!!!! thank you!

  4. #4
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Quote Originally Posted by LONeillSSC View Post
    Thank You, JoeFoot! You definitely understood my issue. I made the change to set n = -1, but it looks the data is still off one row. I would expect the header to be in the defined header row (set properties on ListBox to indicate Headers). Below is what the data now looks like:

    Header Row (nothing is populated)
    line 1 - displays header from the datatab
    line 2 - displays the first instance of the record found
    line 3 - displays the second instance of the record found

    I tried to change n=-1 to n=-2, but I get a "Run-time error '9" Subscript out of range"

    I do appreciate your time!!!! thank you!
    Just some additional information - I did try changing the properties on the ListBox for ColumnHeades to "False" - and the data then posts into the ListBox correctly. I'd prefer to have the ColumnHeads if possible, but it seems that this is what is preventing the data from pasting properly - where the headers from the datatab past into Row1, instead of ColumnHead of the ListBox.

  5. #5
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    OK....I'm getting there....
    I figured out how to get the headers from the data tab to actually past into the ColumnHeads on the ListBox - I needed to add the following code:

    With Me.ListBox1
    .RowSource = Range("A3:AF3").Address
    End With
    But now I'm getting Run-time error '70: Permission Denied, and it's pointing to this line of the code:
    If n > 0 Then Me.ListBox1.Column = a

    I'm so close.........I'm sure it's something that's an easy fix that I just can't figure out because of my limited knowledge of VBA....once again....THANK YOU for any help you can provide!!!!

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    You can't have headers unless you are populating the listbox from a range via RowSource.

    If you really want headers you could add a set of labels above the listbox, populate them with the headers and align them with the appropriate columns.

    Also, if you do use RowSource you can't use other methods, eg AddItem, Column etc to populate the listbox, that's why you get the 'Permission denied' error.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Thanks, Norie....So it sounds like i need to modify my original code posted above?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    I thought you said the code worked when you set to False?

    If that's the case why not do that and try my suggestion of a set of labels for the headers.

  9. #9
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Hi Norie:

    The ListBox will have 31 columns of data - from what I read, if you do headers the way you suggest, as you scroll through the columns, the headers won't scroll as well. I will continue to play with this. Thank you!

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Why would you want the headers to scroll?

    Shouldn't they be a permanent fixture at the top/above the listbox?

    If you were populating the listbox from a range using RowSource and had ColumnHeads set to True the headers wouldn't scroll either.

  11. #11
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    FORM mod 070115 Sample.xlsm

    Here is a sample of my database if this will help.

  12. #12
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    OK....I've got my ListBox for the found records working - not how I ideally would like it, but it serves it's purpose of identifying multiple records so the user can select the record to be edited. Now I'm stuck with my Save code. I've tried to recall a record, edit it, and save the changes, but nothing is happening when I hit save - which means it's encountering an error, but I' can't tell where. Here is my code:

    Private Sub cmdSave_Click()
        Application.ScreenUpdating = False
        If r <= 0 Then Exit Sub
    
        Set c = Ws.Cells(r, 1)
        c.Value = Me.tbMemNum.Value          ' write amendments to database
    c.Offset(0, 1).Value = Me.tbDate1.Value
    c.Offset(0, 2).Value = Me.cboIssueType.Value
    c.Offset(0, 3).Value = Me.cboIssueReportedBy.Value
    c.Offset(0, 4).Value = Me.tbDateIssue.Value
    c.Offset(0, 5).Value = Me.cboIssueStatus.Value
    c.Offset(0, 6).Value = Me.tbSource.Value
    c.Offset(0, 7).Value = Me.tbOpenDate.Value
    c.Offset(0, 8).Value = Me.tbEnrollMeth.Value
    c.Offset(0, 9).Value = Me.cboUI.Value
    c.Offset(0, 10).Value = Me.tbFName.Value
    c.Offset(0, 11).Value = Me.tbLName.Value
    c.Offset(0, 12).Value = Me.tbAddress.Value
    c.Offset(0, 13).Value = Me.tbCity.Value
    c.Offset(0, 14).Value = Me.tbState.Value
    c.Offset(0, 15).Value = Me.tbZip.Value
    c.Offset(0, 16).Value = Me.tbFraud.Value
    c.Offset(0, 17).Value = Me.tbBonusPt.Value
    c.Offset(0, 18).Value = Me.tbGoldPt.Value
    c.Offset(0, 19).Value = Me.tbOtherPt.Value
    c.Offset(0, 20).Value = Me.tbPtsRedeemed.Value
    c.Offset(0, 21).Value = Me.tbPoint.Value
    c.Offset(0, 22).Value = Me.tbDollar.Value
    c.Offset(0, 23).Value = Me.cboSiteID.Value
    c.Offset(0, 24).Value = Me.Brand.Caption
    c.Offset(0, 25).Value = Me.SiteAdd.Caption
    c.Offset(0, 26).Value = Me.GM.Caption
    c.Offset(0, 27).Value = Me.Owner.Caption
    c.Offset(0, 28).Value = Me.tbSummary.Value
    c.Offset(0, 29).Value = Me.cboCredit.Value
    c.Offset(0, 30).Value = Me.tbCrAmt.Value
    c.Offset(0, 31).Value = Me.tbCrDate.Value
        'restore Form
        With Me
            .cmdSave.Enabled = True
            .cmdAdd.Enabled = False
            .Height = frmHt
        End With
        If Sheet1.AutoFilterMode Then Sheet1.Range("A1").AutoFilter
        Application.ScreenUpdating = True
        On Error GoTo 0
    End Sub

  13. #13
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Still trying to figure this out....

    Quote Originally Posted by LONeillSSC View Post
    OK....I've got my ListBox for the found records working - not how I ideally would like it, but it serves it's purpose of identifying multiple records so the user can select the record to be edited. Now I'm stuck with my Save code. I've tried to recall a record, edit it, and save the changes, but nothing is happening when I hit save - which means it's encountering an error, but I' can't tell where. Here is my code:

    Private Sub cmdSave_Click()
        Application.ScreenUpdating = False
        If r <= 0 Then Exit Sub
    
        Set c = Ws.Cells(r, 1)
        c.Value = Me.tbMemNum.Value          ' write amendments to database
    c.Offset(0, 1).Value = Me.tbDate1.Value
    c.Offset(0, 2).Value = Me.cboIssueType.Value
    c.Offset(0, 3).Value = Me.cboIssueReportedBy.Value
    c.Offset(0, 4).Value = Me.tbDateIssue.Value
    c.Offset(0, 5).Value = Me.cboIssueStatus.Value
    c.Offset(0, 6).Value = Me.tbSource.Value
    c.Offset(0, 7).Value = Me.tbOpenDate.Value
    c.Offset(0, 8).Value = Me.tbEnrollMeth.Value
    c.Offset(0, 9).Value = Me.cboUI.Value
    c.Offset(0, 10).Value = Me.tbFName.Value
    c.Offset(0, 11).Value = Me.tbLName.Value
    c.Offset(0, 12).Value = Me.tbAddress.Value
    c.Offset(0, 13).Value = Me.tbCity.Value
    c.Offset(0, 14).Value = Me.tbState.Value
    c.Offset(0, 15).Value = Me.tbZip.Value
    c.Offset(0, 16).Value = Me.tbFraud.Value
    c.Offset(0, 17).Value = Me.tbBonusPt.Value
    c.Offset(0, 18).Value = Me.tbGoldPt.Value
    c.Offset(0, 19).Value = Me.tbOtherPt.Value
    c.Offset(0, 20).Value = Me.tbPtsRedeemed.Value
    c.Offset(0, 21).Value = Me.tbPoint.Value
    c.Offset(0, 22).Value = Me.tbDollar.Value
    c.Offset(0, 23).Value = Me.cboSiteID.Value
    c.Offset(0, 24).Value = Me.Brand.Caption
    c.Offset(0, 25).Value = Me.SiteAdd.Caption
    c.Offset(0, 26).Value = Me.GM.Caption
    c.Offset(0, 27).Value = Me.Owner.Caption
    c.Offset(0, 28).Value = Me.tbSummary.Value
    c.Offset(0, 29).Value = Me.cboCredit.Value
    c.Offset(0, 30).Value = Me.tbCrAmt.Value
    c.Offset(0, 31).Value = Me.tbCrDate.Value
        'restore Form
        With Me
            .cmdSave.Enabled = True
            .cmdAdd.Enabled = False
            .Height = frmHt
        End With
        If Sheet1.AutoFilterMode Then Sheet1.Range("A1").AutoFilter
        Application.ScreenUpdating = True
        On Error GoTo 0
    End Sub

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,356

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Your code stops on following line

    If r <= 0 then exit sub
    for the simple reason that you don't assign a value to r at the beginning of your code.

    I guess r represents the rownumber of the record you're trying to save changes to, but you have to lookup the rownumber first in your database before you can go further saving your changes.
    In order to achieve this every record will need a unique identifier that you can use to retrieve the correct rownumber to save your changes.

  15. #15
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Thanks, Bakerman2! I've modified the code to the following, where I set the value of r, but I still get the same issue, nothing is happening:

    Private Sub cmbSave_Click()
        Application.ScreenUpdating = False
        If rng Is Nothing Then GoTo skip
        For Each c In rng
            If r = 0 Then c.Select
            r = r - 1
        Next c
    skip:
        
        Set c = ActiveCell
        
        c.Value = Me.tbMemNum.Value          ' write amendments to database
    c.Offset(0, 1).Value = Me.tbDate1.Value
    c.Offset(0, 2).Value = Me.cboIssueType.Value
    c.Offset(0, 3).Value = Me.cboIssueReportedBy.Value
    c.Offset(0, 4).Value = Me.tbDateIssue.Value
    c.Offset(0, 5).Value = Me.cboIssueStatus.Value
    c.Offset(0, 6).Value = Me.tbSource.Value
    c.Offset(0, 7).Value = Me.tbOpenDate.Value
    c.Offset(0, 8).Value = Me.tbEnrollMeth.Value
    c.Offset(0, 9).Value = Me.cboUI.Value
    c.Offset(0, 10).Value = Me.FName.Value
    c.Offset(0, 11).Value = Me.LName.Value
    c.Offset(0, 12).Value = Me.Address.Value
    c.Offset(0, 13).Value = Me.City.Value
    c.Offset(0, 14).Value = Me.State.Value
    c.Offset(0, 15).Value = Me.Zip.Value
    c.Offset(0, 16).Value = Me.tbFraud.Value
    c.Offset(0, 17).Value = Me.tbBonusPt.Value
    c.Offset(0, 18).Value = Me.tbGoldPt.Value
    c.Offset(0, 19).Value = Me.tbOtherPt.Value
    c.Offset(0, 20).Value = Me.tbPtsRedeemed.Value
    c.Offset(0, 21).Value = Me.tbPoint.Value
    c.Offset(0, 22).Value = Me.tbDollar.Value
    c.Offset(0, 23).Value = Me.cboSiteID.Value
    c.Offset(0, 28).Value = Me.tbSummary.Value
    c.Offset(0, 29).Value = Me.cboCredit.Value
    c.Offset(0, 30).Value = Me.tbCrAmt.Value
    c.Offset(0, 31).Value = Me.tbCrDate.Value
    
        'restore Form
        With Me
            .cmbSave.Enabled = True
            .cmbDelete.Enabled = True
            .cmbAdd.Enabled = True
            ClearControls
            .Height = frmHt
        End With
        If FraudTracker.AutoFilterMode Then FraudTracker.Range("A1").AutoFilter
        Application.ScreenUpdating = True
        On Error GoTo 0
    End Sub

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,356

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    I've made a small example file because you're still missing the point.
    View the code, specially the CommandButton1 code(Save Changes).
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Ah....I think I understand what you are saying. I will play around with this over the weekend and let you know how I make out. THANK YOU SO MUCH!!! Have a great one!

  18. #18
    Registered User
    Join Date
    08-19-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    13

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    bakerman2 - THANK YOU SO VERY MUCH!!!! Your solution worked PERFECTLY, with a few minor tweaks!!!! (sorry for the delay - I didn't get to attempting your solution until this morning!) Once again, THANK YOU!!!!

  19. #19
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,356

    Re: User Form ListBox - Find Records (ListBox Populating Issue)

    Glad I could help you out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Need help with populating Listbox from another Listbox(selection); across userforms.
    By SoulPrisoner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-28-2013, 12:54 PM
  2. Having problems populating a multicolumn listbox changing Listbox column with a loop.
    By Aristizabal95 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2013, 12:41 PM
  3. Populating a listbox based on column of first listbox
    By tucanj in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-13-2013, 09:26 PM
  4. Listbox of Unique Records populating another listbox
    By web2xs in forum Excel General
    Replies: 1
    Last Post: 04-16-2009, 11:27 PM
  5. populating a listbox on a user form?
    By lrhodes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2006, 07:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1