Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 14th, 2006, 04:19 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search tool.

Hey there, I dont know if this has been asked about befor but here goes.

I was wondering if there was by any chance a program that works like a search function for Office access, My boss has been nagging me to make one and i'm kind of out of ideas.

I would appriciate all the help I can get :)

Reply With Quote
  #2 (permalink)  
Old December 14th, 2006, 07:38 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

To search the entire Access db? Or just a table/query within a db?

Both are possible, but not sure what you are after? Kinda depends on your database really.
Reply With Quote
  #3 (permalink)  
Old December 14th, 2006, 08:16 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

to search within a table/query for keywords :)

or simply "BSI" under "projects"

Reply With Quote
  #4 (permalink)  
Old December 14th, 2006, 09:21 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Svenni,

This is just my approach, I hope it is helpful, sorry to be blunt if I am!
Without trying to teach you to suck eggs, there are a myriad of ways to do a "search", it totally depends on the development you already have and also by what you consider to be a search (this is defined by your users, and you: searching is one thing, doing something after the search has occurred is an entirely different thing). This is a fairly high-level approach, I hope you understand... the work needed to provide what you need may be small, stolen, gifted, large, cumbersome etc... regardless of the source and its complexity: it NEEDS to be useful to the user. So some thought about your data, and how the user interacts with it has to occur.

EG:
Dependant on how you display your data, you could use a filter. Is the field, you are looking for data in, a text field, or is a referenced (lookup) field? Personally, if it is a lookup, which I think it may be (from your Field heading) then it could be preferable to provide a combobox of the Projects in your db, and then filter the data based on the selection - the main benefit of this is that your user (your Boss!) isnt searching for things that don't exist.
Of course, this may not be suitable, but it just gives you an example of the different angles to approach the development from... it should be user requirement driven.

You may find a generic find function out there, or you could write one... to iterate through all your tables and identify any instances of the search string in any of the fields in the table but I doubt it will be of any particular use without a considerable piece of code to ensure the right actions are then taken to put the "found record" into a useful state, ie: viewable via the correct form for the context of the data required, which may be unknown, to the db anyway!

So, frankly my suggestion would be to ask your Boss... which form (s)he would like the search on, and then which fields in the form. Then you need to look at the datatype of the fields required and decide what is the best approach... either filtering or finding. Personally, I would then build individual routines for each type of filter or find... you may be able to group some of these into generic ones, but often the extra time spent in understanding the commutivity of the methods is more than "just doing it!"

To be totally honest with you, this is development.. making these decisions based on your user requirements.

Hope this helps? Happy to assist more if needed...

Lee
Reply With Quote
  #5 (permalink)  
Old December 14th, 2006, 09:22 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Create a query and pass parameters to it, then display the results in a continuous form, and give the user the option to open the record.

Pass parameters by creating your query, then adding criteria to the appropriate fields like this:

Criteria:
Like "*" & [Type the phrase of letters you are looking for:] & "*"

This will pop up a parameter dialog box, and pass the string and search the field you indicate.

This works on one field at a time. If you want to do all fields in a table, let me know and I will do the button code.

HTH

mmcdonal
Reply With Quote
  #6 (permalink)  
Old December 14th, 2006, 09:26 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hehe, thanks for all your help.

My boss decided to cancel my "search" for a "search" function, and put me on another assignment.

So again, thanks for all the trouble :P

Reply With Quote
  #7 (permalink)  
Old December 14th, 2006, 09:40 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Result!
Reply With Quote
  #8 (permalink)  
Old December 14th, 2006, 12:44 PM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HARRR, despite my boss's decicion I myself want to finish this :P

so far

Expr1: "*" & [Type the phrase of letters you are looking for:] & "*"

int he first Field I have about 20 tables I want it to search through, any help :P ?

Reply With Quote
  #9 (permalink)  
Old December 14th, 2006, 02:12 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

This wouldn't be an expression. You would make this the criteria you want to search for in a named field. Put it on the line that says "Criteria" in the designer.

It must have this syntax:
Like "*" & [Type the phrase of letters you are looking for:] & "*"

If you want to search the whole database, you can do that with code and an input box.

The thing is, why would you want to search for a single string in 20 tables? How denormalized is this database? Are they different iterations of the same data? If so, string them together and then search them.




mmcdonal
Reply With Quote
  #10 (permalink)  
Old December 15th, 2006, 04:18 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hmm, this database consists of about 20 tables all catagorized the same way, so basicly by searching in the "Projectnumber VS" colum I can search through the whole database for the "Project number"

numbers are
"VS000701"
"VS000702"

etc..

so, 20 tables that contain Project numbers and the column that contains them are all named the same in each table:)

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 07:36 PM
File Search / Indexing Search with .net 2.0 maulik77 ASP.NET 1.0 and 1.1 Basics 2 March 15th, 2007 12:45 AM
Regarding Search Tool in ASP Page.Urgent Help Need anand_asv Classic ASP Basics 2 February 7th, 2006 05:03 AM
Search Engine for Full-text Search Kala ASP.NET 1.0 and 1.1 Professional 2 August 29th, 2004 02:16 AM
Search engine that search through local drive! wenzation Classic ASP Basics 0 August 26th, 2003 09:15 PM



All times are GMT -4. The time now is 08:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.