Creating a user form search query with option to edit results

WombatTrax

New Member
Joined
Jul 10, 2012
Messages
10
I am trying to create a search query on a user form that is linked to a seperate spreadsheet. I have 3 text fields in the userform that can be filled in. Using a command button, I would like the userform to search any or all 3 columns linked to the text fields and return the results in a list. The user should then be able to select the row with the correct data and be able to edit any of the 9 fields of that row, then save it with the updated data.I would also like a message box to appear that says "No results found" if there are no matches in the database. Is this possible? I am fairly new to VBA and am unsure of how to code this. Also, the company I work for is limited to using excel 2003 on windows XP. Thank you in advance for any advice/help.
 
Hello,

I am quite new in VBA, but I am really trying to learn.

I have seen your code and it fits perfectly for a project I am working on in my company.

I can more or less understand it but the problem is the List Box. I don´t understand what is for therefore I don´t understand the code behind that. I copy the whole macro and I have changed the references where I found your comments but somehow it is not working. I can look for something and I get the "Result" sheet, but In the list box and in the text boxes nothing appears. I cannot also use the update button :(

Can you maybe help me out?

Best,

Victoria
 
Upvote 0
I am new to VBA coding and struggle with it. I copied your code and made the changes you recommended. When I try to search a record, I get a compile error: can't find project or library. When I click OK, it highlights in yellow Private Sub buttSrch_Click(), and highlights in blue Set rgData below that. The only change I made was to the sheet name where you indicated 'change to suit. Can you help me get past this?
 
Upvote 0

Forum statistics

Threads
1,226,812
Messages
6,193,116
Members
453,777
Latest member
Miceal Powell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top