Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Display Search results in a List box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bejewell - 01 Mar 2006 17:57 GMT
Please forgive me if this is an obvious question...

My database houses a list of files and their locations on our company's
network.  My master query includes the file name, the file's current
location, and its old location, among other things.

I have created a form that allows the user to search the master list for
locations (really network folders) containing his/her specified criteria.  
Several of these folders have similar names ("Environmental Justice",
"Environmental Tracking", "Environmental Management", etc.), so if the user
enters the word "Environmental" as his/her criteria, the search results
include items in all of these folders.

I would like the results of the search to display so that all of the folders
meeting the criteria appear in a list box, allowing the user to select the
specific folder he/she is looking for and pull up a list of only the files
inside that folder.  

Is this possible?  It must be!  I just haven't had any luck figuring out how
to make it happen.  Perhaps the answer is staring me right in the face but
I'm missing it?

Any help would be greatly appreciated...Thanks so much!!
Klatuu - 01 Mar 2006 19:00 GMT
This can certainly be done; however, since you already have the search
working, it would be important to know what method you are using to
accomplish the search and where the results of the search is.

Also, do you want the user to be able to select one folder or multiple
folders from the list?

> Please forgive me if this is an obvious question...
>
[quoted text clipped - 19 lines]
>
> Any help would be greatly appreciated...Thanks so much!!
bejewell - 01 Mar 2006 19:19 GMT
The user should only be able to select one folder from the list.

In my query, in the "criteria" row of the "Current Locations" column, I have
entered:  

Like "*" & [Enter Phrase to Search] & "*"

I then created a form based on this query, which, when run, prompts the user
for a search term.  The resulting form includes all of the records that meet
the criteria entered.  

It works as long as the "Current Folders" field is a text box - it just
displays each record with its current folder in the field.  But when I change
it to a Combo Box (sorry, I've been calling this is a list box, I actually
mean a combo box, because I want the user to be able to select a specific
folder from a dropdown list of folders that meet the criteria), it only shows
the current folder and a blank row in the dropdown.

Hope this answers your question??

> This can certainly be done; however, since you already have the search
> working, it would be important to know what method you are using to
[quoted text clipped - 26 lines]
> >
> > Any help would be greatly appreciated...Thanks so much!!
Klatuu - 01 Mar 2006 19:56 GMT
Okay, here is how you do that.
Create a text box on your form for the user to put the value in instead of
letting the query pop up and ask for a value (ugly anyway).
Change the criteria in your query to look for the value in your text box:
Like "*" & Forms!MyFormName!MyTextBoxName & "*"

Make the query the row source of the combo box

In the After Update event of the text box,

Me.MyComboBox.Requery

Now, when the user puts a value in the text box and navigates away from it,
the combo will requery with what the user is looking for.

Now, if you want to get really fancy with it, you can use what is called
Cascading Combos.  That is, rather than using a text box to enter the
criteria, Use a combo with a row source that will allow the user to select
something to look for.  Everything else remains the same, you still use the
query the same way, you still do the requery in the after update, etc.

> The user should only be able to select one folder from the list.
>
[quoted text clipped - 46 lines]
> > >
> > > Any help would be greatly appreciated...Thanks so much!!
bejewell - 03 Mar 2006 15:48 GMT
Thanks so much for your help!  I really appreciate it!

> Okay, here is how you do that.
> Create a text box on your form for the user to put the value in instead of
[quoted text clipped - 67 lines]
> > > >
> > > > Any help would be greatly appreciated...Thanks so much!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.