+ Reply to Thread
Results 1 to 17 of 17

Search and Update

  1. #1
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Search and Update

    Hello Forums!, can anyone help me with my search and update form?

    I just want when in input a data in Textbox4, it will search it sheet1 and populate the Textboxes else a messagebox will prompt "No Records Found!".

    Also, in Commandbutton1, when searching is successful, when i amend something in the textboxes and click the "Amend" button, that data will amend in sheet.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Search and Update

    Just one question: why you are using Textbox4 in which you have to enter the employee name manually and why not ComboBox1?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Search and Update

    Something like this?
    Attached Files Attached Files
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  4. #4
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    Hi Sir Sixthsense, actually this is part of my multipage form (Add New and Update Tab), the form attached is only the Update Tab, the combobox1 will use only on Add New Tab and will not be amended in Update Tab (hope u get what i mean despite my bad english ).


    Hi Sir JapanDave,

    I've run the amended file but it add new a line when i click amend button, i just want when the user search, it will update in the same line.


    Also, is it possible to run the code eventhough the combobox1 enabled set to false in userform intialize event? I just want textbox4 will only enabled when userform initialize.
    Last edited by siobeh; 04-24-2013 at 12:18 AM.

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Search and Update

    Try this file and amend Jason's data.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    looks closely JapanDave , just need some modifications here:

    1. When the user click Amend button, i just want to clear the textboxes and combobox so that
    user can search another data and not exit the form. I will make a button for exiting.

    2. When user enter a data in textbox4 that is not in sheet1, messagebox will prompt "No Records Found!".


    Also, is it possible to run the code eventhough the combobox1 enabled set to false in userform intialize event? I just want textbox4 will only enabled when userform initialize.

  7. #7
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    Also, is it possible to run the code eventhough the combobox1 enabled set to false in userform intialize event? I just want textbox4 will only enabled when userform initialize.
    Last edited by siobeh; 04-24-2013 at 02:01 AM.

  8. #8
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Search and Update

    OK, I think I know what you are looking for.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    looks perfect JapanDave!, how about number 2? prompting messagebox if user input a data in textbox4 but not in sheet1?

    Also, when userform Initialize, i just want Textbox4 only be Enabled, is it possible run the code like that? initially, textbox4 and combobox1 is enabled, i just want textbox4 only.

  10. #10
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Search and Update

    If you leave the amend button active, you can do that.

    See below.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    Perfect JapanDave!, last one, when i tried to search the name and amend the name at the sametime, msgbox is still prompting. I also want the textbox4 can be amended. For example, the user save a incorrect name, he/she can amend it.

    Ex: User search name "Jason" then user wants to change "Jason" to "John".

  12. #12
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    can anyone help me please

  13. #13
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Search and Update

    Hold on a bit, I have to get some sleep. I will sort this out shortly.

  14. #14
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    No worries

  15. #15
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Search and Update

    Ok, try this,
    Attached Files Attached Files
    Last edited by JapanDave; 04-25-2013 at 05:49 AM.

  16. #16
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Search and Update

    Awesome JapanDave! , I have a question, how I do change the value of combobox1 to "Nickname Value". I add another Column to your file. I thought combobox value should be "Name" but my supervisor advise me that it should be "Nickname". Sorry for bothering and confusion.
    Attached Files Attached Files
    Last edited by siobeh; 04-25-2013 at 02:23 PM.

  17. #17
    Registered User
    Join Date
    04-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Search and Update

    hi i have some ask.. how to make a search and update/edit using textbox and listbox? or textbox... the file attached its only one button .. i want to separate button..but i want data to display in listbox all with Show that data in the multicolumn Listbox if i click it automatic to other form that compose some textbox :D i hope all you help me..


    thanks in advance more power... ^_^
    Last edited by sunguhan2013; 04-28-2013 at 03:51 AM.

+ 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