MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

user form with search criteria

  Asked By: Bertha    Date: Jan 14    Category: MS Office    Views: 2965

I want to thank all the newsgroup from all my heart. Being with you
means very much for me and my job. Your help it's being very important
when I work on different ideas. Thank you guys!

If anybody knows how set up a user form with search criteria please
share your knowleadge with me. I am looking to make a form with
different fields to lookup in the database and find specific records
depending on the criteria I will have on the form.



12 Answers Found

Answer #1    Answered By: Jackson Williams     Answered On: Jan 14

Is there a fixed number of criteria?

Answer #2    Answered By: Ethan Evans     Answered On: Jan 14

Yes, for the moment is a fixed number of criteria: Category, Products and Price.
Maybe futher I will have to add more criteria, depends on how the form  will

Answer #3    Answered By: Komal Mohammad     Answered On: Jan 14

It seems to me you have some idea of how to settle this problem. If you
know, please let me know too.

Answer #4    Answered By: Chau Tran     Answered On: Jan 14

So let me try and understand what you want. As I understand it you have a
"database" in Excel and you want a user  to enter data in a user form  so you
can look up what the user wants.

We can go further with a user form if you like but have you tried Auto

Answer #5    Answered By: Viheke Fischer     Answered On: Jan 14

That's exactly what you understand. You suggest me do it with Auto Filter.
It's a good idea. Me, personally, I know how to make with Auto Filter so to
extract exactly what I want from a range of data, by adding a line with column
names above the data range and then apply the auto filter. Yes. It's not a
problem, but user, he/she may find it difficult, so I thought to ease it by the
user form. To offer the user  the possibility to enter the criteria  in the
fields, then get whatever he/she is looking for by simple click of the button.
You see. If you have any suggestion of how to make this out, please help.

Answer #6    Answered By: Jeanette Greene     Answered On: Jan 14

Won't the Built In form  work? Data, Form???

Answer #7    Answered By: Isabella Campbell     Answered On: Jan 14

Maybe it would work  the Built In form  as you
say, but the problem is that I don't know how to make it. Would you please
suggest how it maybe done?

Answer #8    Answered By: Logan Bouchard     Answered On: Jan 14

From the Data menu, select Form. Excel will build it based on the list you
are in using the column headings as field names.

Answer #9    Answered By: Aidyn Smith     Answered On: Jan 14

I know this very well, but I want this form  come available from the database I
am building. That's to give the possibility to the user  to click the button and
make the form available and get the result. More than that, I don't want the
user see the data range of the database, in order to avoid him/her change it by
mistake. It will be placed on a hidden sheet. Do you see. Additionally, futher,
I am planning to make possible to build a report based on the criteria. So the
idea you propose doesn't work  in this case.

If you can help  get the search  criteria user form I will be very glad.

Answer #10    Answered By: Abbad Akhtar     Answered On: Jan 14

Sure it will. Record some code of you turning on the Form. Then attach
that code to the Workbook Open event. You'll need to play with that to see
exactly which event the code should be in to suit your purposes, but that
will allow you to use the built in search  form, and not show the data.

Answer #11    Answered By: Cais Nguyen     Answered On: Jan 14

You are right. I put this tiny code and it works "ActiveSheet.ShowDataForm".
That's very easy I see. But when I put a button on the start menu page which is
a different worksheet than where the data range is I get the run-time error
'1004'. It is obvious, no worksheet is indicated. Then I did some changes and it
looks like this:

Sub OpenSearchForm()
End Sub

It's good no problem. But I don't want the user  to see the data range in order
to avoid accidental change of data. Is it possible to make the code open the
form without activating the worksheet.I know it is, but don't know how to make

Answer #12    Answered By: Jaspreet Kapoor     Answered On: Jan 14

The best way of preventing the user  from changing the data is to protect the
sheet. If you macro needs to change it then you unprotect it in the macro,
make the change, and reprotect it.

To find out how to do this you could use the macro recorder.

Didn't find what you were looking for? Find more on user form with search criteria Or get search suggestion and latest updates.