SheilaAlighieri
Technical User
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
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
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?
Thanks.
Sheila