Hi!
I want VBA code for userform2 to search info about any member by entering member number or member's name and after editing info with update button change should be saved in my database. Please have a look at my attached example file.
Thanks & Regards
Raindrop
Search & Edit VBA Code For Userform
-
- Lounger
- Posts: 36
- Joined: 04 Feb 2013, 06:22
Search & Edit VBA Code For Userform
You do not have the required permissions to view the files attached to this post.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Search & Edit VBA Code For Userform
As an alternative, and before going into custom VBA to built your forms, why not just use the built in Data Form that Excel provides?
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78412
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Search & Edit VBA Code For Userform
If you want to use the userform, I wouldn't use the same text boxes for searching and for editing, that would be very confusing. I'd use either a text box or a combo box for searching, and other controls for editing.
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Search & Edit VBA Code For Userform
Here is a working sample of the built in user form that Excel provides. You can add, search, edit and delete records using this form.
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Lounger
- Posts: 36
- Joined: 04 Feb 2013, 06:22
Re: Search & Edit VBA Code For Userform
Thank You Rudi Sir,
It was nice for your kind help about providing built in user form. Herewith I am attaching a sample file with little bit afford to my custom userfrom, that let me enters new data up to column J. But search gets me data to edit up to column G only that i want to extend up to column j or may be more. I am confused with code.
Thanks & Regards
Raindrop
It was nice for your kind help about providing built in user form. Herewith I am attaching a sample file with little bit afford to my custom userfrom, that let me enters new data up to column J. But search gets me data to edit up to column G only that i want to extend up to column j or may be more. I am confused with code.
Thanks & Regards
Raindrop
You do not have the required permissions to view the files attached to this post.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Search & Edit VBA Code For Userform
Hi Raindrop,
You needed to give the additional controls Tags (the Tag property) so that the code can collect data from the column that matches the tag and fill the textboxes with the values from those columns based on the search row.
Try it now.
Attached.... PS: I'd still prefer to use the built in form (IMHO)
You needed to give the additional controls Tags (the Tag property) so that the code can collect data from the column that matches the tag and fill the textboxes with the values from those columns based on the search row.
Try it now.
Attached.... PS: I'd still prefer to use the built in form (IMHO)
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Lounger
- Posts: 36
- Joined: 04 Feb 2013, 06:22
Re: Search & Edit VBA Code For Userform
Rudi Sir,
Thank you very much for help, little more things I knew.
Thank you very much for help, little more things I knew.