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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Search through form :) Needs some fine tuning

Status
Not open for further replies.

SheilaAlighieri

Technical User
Nov 16, 2002
68
NL
Hi,

I would like to make a search system for my database. I would like my method to use 2 forms; one to gather search criteria, one to retrieve and display results.

On my search form I have two textboxes, txtAccountName and txtBudgetYear.I want the search system to assume that when one of these criteria isn't entered, the user wants to see all available records thereof.

I made a query which uses the above-mentioned criteria as parameters:
[forms]![Budget Search]![txtAccountName]
[forms]![Budget Search]![txtBudgetYear]

When the user has entered the criteria, he/she presses the action button.

I attached the following code to the button:

DoCmd.OpenForm "FormName" or

I have a few problems though. I am not sure how to make the criteria in my query so it shows all records when nothing is entered... or a specific account name for a specific budget year... or all budget years for a specific account.... or all accounts for a specific budget year :) Hope I am still clear!

Furthermore, it is possible that for some criteria there is no data available. Now I see a white form, which I find terribly ugly. Is there a way to show a messagebox stating "The is no data available" or something like that? :) This is possible with the NoData option in reports.. but I don't know how to acquire this result in a form :)

Thanks.

Sheila

 
What's the 'base' SQL (Select Whatever From Wherever) and what's the Where clause you have built (it's in the white box)?

Hard to tell without knowing some details....
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top