473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Creating Customized Search

I created Database and I need to create customize search.

As you can see in the attachment I have 5 drop down list boxes

In my search I need to be able to create a search by choosing all of the boxes or three or two of them and after hitting the Search button a report will appear with the information.

All the Data base information are listed in one table called ( Header). So it’s the Source of the Search.

** Edit **
Adding the image visibly :

Attached Images
File Type: jpg Untitled.jpg (20.0 KB, 333 views)
Aug 9 '10 #1

✓ answered by NeoPa

Delerna has posted a fundamental way of doing such searches. or filtering, dynamically. There are other ways. The filter could be built on the fly in a string, then applied to the DoCmd.OpenForm method as a WhereCriteria parameter for instance.

Bear in mind, when using Delerna's approach, that many Access databases are still set up to default to the SQL-89 standard for Jet-SQL (See ANSI Standards in String Comparisons). As such, they would use the star (*) character in place of the percent (%) which is used for ANSI-92 and beyond.

Welcome to Bytes!

5 1463
Delerna
1,134 Expert 1GB
Here is one method that might work for you

In the query that the report is bound to
Expand|Select|Wrap|Line Numbers
  1. SELECT theFiledList
  2. FROM theTable
  3. WHERE range like '%' & forms!yourSearchForm.cboRange & '%'
  4. and worktype like '%' & forms!yourSearchForm.cboWorkType & '%'
  5. and ContractType like '%' & forms!yourSearchForm.ContractType & '%'
  6.  
In all the combo boxes you need to ensure that the "select" option returns an empty string as its value.

What this will mean is that when no selection is made

WHERE range like '%' & forms!yourSearchForm.cboRange & '%'

will equate to

WHERE range like '%%'

and this means

WHERE range equals anything

You will probably need to play around with the syntax of this to get it working, I posted this out of my head.
The fields need to be of string type or converted to string type for this technique to work. It might also be a bit slow if you have a lot of records

There could an easier/better way so I'll be watching with interest.
Aug 9 '10 #2
Delerna
1,134 Expert 1GB
Incidentally, one of the better ways, I think, is to use access as the data store and develop your forms/reports as web pages.... thats one of the reasons I don't use access much any more.

In a web page I can easily check the selections made in the combo boxes, dynamically build the query accordingly, retrieve the recordset and write the values into an HTML table, textboxes, lists or whatever.


You can also build querydefs dynamically within access but I have found it all too easy to break the database by doing so.
I am talking about access 2003 here
Aug 9 '10 #3
NeoPa
32,556 Expert Mod 16PB
Delerna has posted a fundamental way of doing such searches. or filtering, dynamically. There are other ways. The filter could be built on the fly in a string, then applied to the DoCmd.OpenForm method as a WhereCriteria parameter for instance.

Bear in mind, when using Delerna's approach, that many Access databases are still set up to default to the SQL-89 standard for Jet-SQL (See ANSI Standards in String Comparisons). As such, they would use the star (*) character in place of the percent (%) which is used for ANSI-92 and beyond.

Welcome to Bytes!
Aug 9 '10 #4
thank you Guys I really appreciate your help
Aug 21 '10 #5
NeoPa
32,556 Expert Mod 16PB
No worries. I'm glad we were able to assist :)
Aug 21 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: shovan | last post by:
I am creating a customized Purchase order report using asp. I have developed the reoprt as it is displaying the amount against a sales rep within a specific date range.now values are dispalaying...
2
by: GMK | last post by:
HI ALL I'M COMING FROM A FOX PRO BACKGROUND WHERE I COULD IN A VERY EASY WAY CREATE A SEACH FACILITY BY PRESSING N F1 AND ANOTHER WINDOW WILL DIRECTLY APPEAR WHICH WOULD LET THE USER TO SEARCH...
0
by: shanthsp2002 | last post by:
well friends i have a small tip here which may be helpfull for u there may be situations where we need to use a customized dilogue box while doveloping setup and dyployment project, so u can do...
5
by: jguillen | last post by:
I am new new in php, but I have been achieving some kind of good progress until I reached a problem.... Create a search form that you can select differents options, radio buttons and so on.... I...
3
by: teephish | last post by:
Hello, I'm currently in the process of creating a small access database and I'm having some problems with creating a customized search. I would like the user to be able to search a record by last...
1
by: wbrands2 | last post by:
I have a basic web form that inserts information into a ms sql database and I am trying to create a search page for it. I am running into the problem that after I insert the information into the web...
1
by: DeZZar | last post by:
For anyone that has the 'pleasure' of using Office 2007 you will know of one handy feature built in - its the search function housed in the record selector bar at the bottom of a form that allows...
1
by: cbones | last post by:
Hello, I am trying to create a search button in a windows forms application. I used a Microsoft Access 2007 file as the database and would like to be able to search the file by specific fields. ...
2
by: zandiT | last post by:
Hello everyone i have a mainform called frmMain and it has 2 subforms. the frmMain consists of 2 combo boxes. i want to create a search form whereby the user can choose an option in combo1 and in...
1
by: NLR2008 | last post by:
Hi there, Can anybody help me and provide me with a SIMPLE solution to create a search form in Access 2003. I have created a database for Finance Payments and want to enable the user to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.