Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2009, 12:44 PM
Registered User
 
Join Date: Apr 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create a search on a form using VBA

i have a database at work that that is used to track project progress for environmental cleanup projects. I am trying to create a form (in Access) that uses check boxes to select which criteria to search for and then then have a "Go" button that will launch the search. I want the search to return only those records with info in them. For example if I select criteria 1 and criteria 5 I want that data to return only records that have info in criteria 1 AND critiera 5 not one or the other. Once the search is complete I would like the information to be displayed in a report.

There are only 500 records that contain 32 fields of data per record. There are only 25 criteria that I would like to let people search for. But I would like the report to show all 32 fields.
The fields I wanted searchable are:
contract task order
Phases
Active/Inactive
Category
FDE Date
INPR Status
INPR Date
PA/APA Date
SI Date
RI/FS Date
RD Date
RA-C Date
RA-O Date
LTM Date
IRA Date
EE/CA Date
RmD Date
RmA-C Date
PCO Status
PCO Date
Project NDAI Date
Project Concurrence Date
Property NDAI Date
Property Concurrence Date
Concurrence Status

I am a coding retard and have no clue how to begin. Any info would be greatly appreciated.
culleng
 
Old May 1st, 2009, 12:53 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

To clarify, you want the users to be able to search on 5 fields, or 25 fields? What data types are in the fields you want to allow the users to search on?

The first thing you need to do is to create the query and report you want to display when the search is run. Just include the fields you want in the report (in the query) and don't worry about parameters.

I have done this for another application and will post some code if you can answer the questions.
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old May 1st, 2009, 01:11 PM
Registered User
 
Join Date: Apr 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Clarification

I want the users to be able to pick from 25 fields. However, if they only want to select 5, 2 ,18, or any number I want that to be possible as well. There are 4 text fields and 21 date/time fields.

The form I am using has a 25 check boxes on it. I want the user to select the check boxes for the criteria they want in the report then hit a GO button and get the report.

If I were to create queries and reports for every different combination of selected fields it would probably crash my database. I want the report to be dynamic in the fact that what ever the users selects as criteria they will get back in a report. I want the report to be specific to what each users requests. So if they select 6 criteria I want the report to get just those 6 criteria. Then the next time if they want 9 criteria they can get that too.

I also want it to be so simple that I can show them how to select the data they want and get the report they want that I won't have to do anything else. I am trying to help a bunch of non-computer literate people be able to use computers without fear of messing something up.

Hope this is enough info.
Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create User Search Form JezLisle Access 1 November 6th, 2008 11:22 AM
Create VBA Feedback Form neodjandre Excel VBA 0 October 16th, 2007 04:34 PM
VBA code to Search All Text Fields on a form dezmond2 BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 July 7th, 2007 11:58 AM
Create rectangle on a form with Vba Coby Access VBA 2 June 25th, 2007 04:11 PM
Create Search Button on Access Form BKILBAN Access VBA 1 February 27th, 2004 09:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.