+ Reply to Thread
Results 1 to 3 of 3

Help to program a search form

Hybrid View

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2003
    Posts
    10

    Help to program a search form

    Hi everyone,

    I am building a new excel based database and need help.

    I have created the structure, single file with 3 sheets, one for navigation and form access, one for data storage and one for field setup. My form is created and the main goal is to search for the data stored using one of the fields (account).

    Please advise in case the attachment is not clear enough.

    Regards to all for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help to program a search form

    Private Sub Image1_Click()
    'go look for the CLS account in the worksheet data of this workbook
    Dim ws As Worksheet:    Set ws = Sheets("data")
    Dim rFind As Range
    Dim i As Integer
    
    Set rFind = ws.Range("B1:B" & ws.Range("B" & Rows.Count).End(xlUp).Row).Find(What:=txt1.Text, LookIn:=xlValues, LookAt:=xlWhole)
    
    If Not rFind Is Nothing Then
        txt2.Value = ws.Range("C" & rFind.Row).Value
        txt3.Value = ws.Range("D" & rFind.Row).Value
        txt4.Value = ws.Range("E" & rFind.Row).Value
        txt5.Value = ws.Range("I" & rFind.Row).Value
        txt6.Value = ws.Range("H" & rFind.Row).Value
        txt7.Value = ws.Range("F" & rFind.Row).Value
        txt8.Value = ws.Range("K" & rFind.Row).Value
        txt9.Value = ws.Range("J" & rFind.Row).Value
        txt10.Value = ws.Range("L" & rFind.Row).Value
    End If
    
    End Sub

  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Help to program a search form

    HI,

    Many thanks for your help.

    issue solved.

+ 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. Duplication of a Form in same Excel VB Program
    By gharding14 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2014, 02:40 PM
  2. How do I program a 'click' for a button on a form
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2009, 08:54 AM
  3. Form closing Excel program?
    By jimbo_jones in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2007, 03:34 PM
  4. Add code to a excel's form created by program (Vb .Net)
    By Pablo via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 06-29-2005, 09:05 AM
  5. Program search
    By Gwen in forum Excel General
    Replies: 1
    Last Post: 01-27-2005, 05:06 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