+ Reply to Thread
Results 1 to 5 of 5

UserForm to search sheet, show results on separate userform?

  1. #1
    Registered User
    Join Date
    05-23-2010
    Location
    istanbul
    MS-Off Ver
    Excel XP
    Posts
    3

    UserForm to search sheet, show results on separate userform?

    okay well I am quite a newbie in all these stuff. and my intention is not requesting a complete project from anyone if there isn't anything already made. I just would like someone to guide me in all these stuff..

    I have made a userform that would add entries to my book database. and now I want something else. I would like a new userform that will have textboxes, and a search button that will search the columns according to the ids and show the results on a separate form(this one not that important).

    here's an example of what I am talking about:

    column
    a b c d ........
    book name author date pages .......

    the search userform would have textboxes and when I search, it would search the specific columns.
    textbox1 will search column a
    textbox2 will search column b
    and so on...

    and even further I would like to add another textbox that will search the whole sheet?

    I hope that was clear enough
    I searched the forum, and the web, but couldn't find the exact thing I was looking for. I am sure it is somewhere out there, but guess I was a bit impatient. if you happen to know any example for this, or if you can guide me where to start, or what to search for, I would be really glad.

    thanks in advance..

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: UserForm that will search the sheet and show the results on a seperate userform?

    Hi and welcome to the forum. Its always better to post a dummy workbook than to put data in the contexts of your post.

    Have a look at this database example http://www.excel-it.com/phpmv2/phpmy...E:vba/DataForm. It might have the basics of what you are looking for.

    abousetta

  3. #3
    Registered User
    Join Date
    05-23-2010
    Location
    istanbul
    MS-Off Ver
    Excel XP
    Posts
    3

    Re: UserForm to search sheet, show results on separate userform?

    EDIT
    abousetta,
    the link you have given is in fact real close to what I am looking for. but it in itself for some reason gives error from time to time, and I couldn't exactly modify it to my needs. but will be working on that.. thanks a lot!

    that sure took me one step further. but seems like I got much more questions now
    the thing is the more I search, the more I want in my userform..
    let me try to explain what I want one more time. and maybe there is something exactly like that, or you might guide me once more..

    there are 9 columns which contain information of books in my library. I made a userform that enables me to add new entries.
    now I want a userform that will allow me to search, display, and edit results.

    I have columns from a to i
    there are books a, b, c which have the same author, call it x
    - when I search for the author x, it will display all the three results in a listbox, and I will be able to go next & prev books with two other buttons. (these buttons will display all the info of the next & prev result in the search fields)
    - if I write "x" on the author textbox, and "a" on the book textbox it will only show me that unique entry on the listbox.
    - all the results should also be displayed in the search fields when I hit the search button.
    - there will also be an "edit" button clicking on which will update the data on the specific fields I changed in the search results.

    alright I know it looks like I am asking for way too much. but I have seen all these examples separately in other examples, and that is why I am asking again. I just can't seem to work around and merge all those things. most of the examples are too specific for other uses, and I can't get exactly what I want. I tried to solve some of the codes and stuff, but still not much luck. I will be very glad if someone can help me on this.

    thanks again
    Last edited by egemenkepekci; 05-24-2010 at 10:51 PM.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: UserForm to search sheet, show results on separate userform?

    Hi egemenkepekci,

    I'm glad the link was somewhat helpful. I am an amateur at vba and so I won't be able to help too much, but there are some real pros here that I hope will be able to assist you much more than me. The one strong piece of advice I can give you is plan your database carefully, try to group the similar functions together and post an example of each specific group of questions separately. When someone is able to help you answer one question, then use the answer to learn the vba methodology behind it and develop it futther to answer more of your unanswered questions. The take-home message is that you will have to do a lot of the work yourself, which is fact a good thing because it builds your knowledge base.

    Also if you have found similar posts that are similar to the question you are posting and can't figure out how to modify it to work correctly, then post a link to it and that will help everyone understand what you are looking.

    Good luck in your search of knowledge.

    abousetta

  5. #5
    Registered User
    Join Date
    05-23-2010
    Location
    istanbul
    MS-Off Ver
    Excel XP
    Posts
    3

    Re: UserForm to search sheet, show results on separate userform?

    hi again
    ok then let me try to start from the very first thing.
    the database you had in your link has almost everything I need, but most of which don't work properly, and I am stuck in modifying the code. so I am gonna try to go one by one, and maybe and hopefully that will teach me something

    the find function:

    when I search something within a column it does display the result in the search fields, and shows the cells in the sheet. however, when I search with multiple textboxes it just ignores it and displays the first possible result according to the first textbox, and shows its results in the search field, and pops up a message box saying "(number) instances of (book)".
    so how would it be possible for me to make a code that will search the database according to the given info and display "only" those entries relevant to it, and display it BOTH in the search field, AND on a listbox? but if there are still multiple possible results, then it should show the first possible in the search field, and that and the rest on the listbox? this thing too in fact is included in the database you have linked, however I couldn't get it to work with mine.

    ahhh I am feeling I am being way too much here. please don't bother to write if you don't feel like it. I will keep searching in any case whenever I have the chance.

    thanks a lot!

    oh and this forum really rocks! lots of things to learn

+ Reply to 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