Closed Thread
Results 1 to 21 of 21

Search through database and display results in userform

Hybrid View

  1. #1
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello karthikcoep,

    The problem is the reference library isn't loaded on the other machines. The workbook I posted has the reference saved. I have added a macro that will automatically load the library reference when the workbook is opened. Here is the auto loading macro which is called by the Workbook_Open() event procedure. This macro is located in Module1.
    Sub AddListViewControl()
    
      Dim P As Variant
      Dim Paths As Variant
      Dim RefFile As String
      Dim X As String
      
        RefFile = "MSCOMCTL.OCX"
        
        Paths = Split(Environ("Path"), ";")
          For Each P In Paths
            X = Dir(P & "\" & RefFile)
            If X = RefFile Then Exit For
          Next P
      
          If X = "" Then
             MsgBox "The directory for " & RefFile & " could not be found."
             Exit Sub
          Else
             RefFile = P & "\" & RefFile
          End If
          
        On Error Resume Next
          Application.VBE.ActiveVBProject.References.AddFromFIle RefFile
          If Err = 0 Or Err = 32813 Then Err.Clear
        On Error GoTo 0
      
    End Sub
    Workbook Open Event - ThisWorkbook Module
    Private Sub Workbook_Open()
      Call AddListViewControl
    End Sub
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-20-2008
    Location
    Mumbai
    MS-Off Ver
    Microsoft Office 2003 and 2007
    Posts
    36

    Re: Search through database and display results in userform

    Thanks a lot Leith.
    May god bless u!!!!!!!!!!!!!

  3. #3
    Forum Contributor
    Join Date
    06-20-2007
    Location
    Buckeye, AZ
    MS-Off Ver
    365
    Posts
    298

    Re: Search through database and display results in userform

    Leith,
    you've come sooo close to solving an project that has stumped me for weeks!
    in my woorksheet (see attached) i'm trying to search list (M) and chose from search list to return to cell D5. "D5:D55" will have this ability. Can you take me this last step?
    thank you,
    sick
    Attached Files Attached Files

Closed Thread

Thread Information

Users Browsing this Thread

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

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