Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull down menus for search criteria??

Status
Not open for further replies.

BLutgen

Technical User
May 25, 2001
47
0
0
US
Is there a way to put in pull down menus for search criteria? Some of my fields are rather long so it would be much easier to select a criteria rather than having to type the entire thing in exactly right. Any thoughts would be great.

Brad
 
No way to add a criteria dropdown, but how about adding a table that you could Copy/Paste the items you need?

Joe Miller
joe.miller@flotech.net
 
Brad - There are at least two ways:

Enter your criteria into a table and make the control source of a combo box on your form the field from that table, and the row source will be that table.

Or, if your values will be fairly static, define the Row source type of the combo box to be a Value list, and in the Row source field enter your criteria, seperated by semi-colons.
 
You can create an unbound combobox on a form, and use the combobox wizard to fill in the search criteria that you would like to be able to choose from, and then in the query's criteria field put
Forms![Formname]![Comboboxname].
(substitute the appropriate names)
You could then put a button on the form that runs the query. So you could use the form to specify the criteria that you would like to search on and to run the query for you. This would make it so that you only have to type alot once. I am doing this exact thing right now.
Hope this makes sense!
Sera
 
Thanks for the help guys. I think that I might just go with the copy and paste. The reason is because I am not searching the information from a form as a subform. I have a command button on the form that runs the actual query itself and prompts for the criteria box. I suppose that I could change this but I think it would be more involved than I want to get since I am not good at defining realtionships between tables what-so-ever. I keep hoping that one day I might get that concept! :) Thanks though!

Brad
 


sSqlSelect = "SELECT [PART NUMBER],DESCRIPTION, EAC,UPE"
sSqlDescrip = "WHERE DESCRIPTION " & Chr(38) & Chr(34) & " " & Chr(34) & " > " & Chr(34) & Chr(34) & _
" And [Part Number] Like " & Chr(34) & "*" & Chr(34) & Chr(38) & _
" [Part_Number] " & Chr(38) & Chr(34) & "*" & Chr(34)

Me.Combo22.RowSource = sSqlSelect & sSqlDescrip & "ORDER BY [Part Number]"

If the part number was 1234567890. I could search for this part number by entering 456 and get all the part number with that sequence in the table.

I know this is vauge but I hope it points you in the right direction.
To object or not to object
That is the question
Alast poor varible I new you well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top